Closed t2gran closed 1 year ago
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days
For example OTP do not have a shared core model for types like
I18NString
. Creating a clean domain model with rich business functionality will make it much easier to maintain, and work with OTP. The ongoing cleanup of the transit model is part of this, but this also apply to other parts of OTP as well.I would like to suggest some general concepts and illustrate this with an example. If we can agree on the concepts, then we can start migrating toward such model.
Concepts
o.o.<domain>.<component>.<sub-component>
Code should be organized by domain functionality, not technology.o.o.<domain>
At the top level we should divide OTP into "domain"s likeapis
,framework
,transit
,street
,astar
,raptor
,feeds
,updators
, andapplication
.component
andsub-component
, a group of packages/classes witch naturally belong together. Sometimes an aggregate(DDD).api
- Used for components to define the programing interface for the component. If present, (see Raptor) all outside dependencies to the component should be through theapi
- never bypass it, with one exception - creating the component.model
- A model as in DomainDrivenDesign like:o.o.transit.model
service
- Like Spring service, the main access-point to interact with the component. In DDD the main access point is the aggregate root, but a service provide access to the aggregate root, and may provide frequenty used utility methods for access to other parts and edit it. TheXyzService
interface can also be at the root level of theapi
package.configure
- Component creation/orchestrationsupport
- Sometimes domain logic get complicated, the extracting/isolating it helps - it isolate the logic and the core domain classes get simpler (the complex stuff is extracted).support
is used internally in a component, not outside.framework
- (Abstract) building blocks internal to a domain/parent package. In some cases accessed outside the component.mapping
- Map between two domains.util
- General "util" functionality, often characterized by being "static". Dependencies to other OTP packages is not allowed, only 3rd party libs witch can be considered utils them self.util
packages can exist on any level, depending on generality/usage.o.o.apis
- OTP external endpoints. Note! Many apis are in the Sandbox where they are in theo.o.ext
package.TODOs
visualizer
go?o.o.apis
oro.o.tools
inspector
go?See also the discussion: https://github.com/opentripplanner/OpenTripPlanner/issues/4284#issuecomment-1190100861
Here is the dependency matrix BEFORE (dev-2.x 2022-11-24) - More than several tousen cyclic dependencies: