In my application Ive separated next levels of application logic:
- Utilities
- Application abstraction
- Simple/common implementation of the application abstraction (#2)
- Concrete application implementation (additional functions and classes to append #3 to fit our final application purposes)
- abstract mvc application architecture (abstraction for mvc logic of application)
- concrete mvc application
Description of these levels:
- Utilities, libraries and so... (doesn't have dependence, maybe used by any concrete class of application)
- Abstract classes of an application. Defines very abstract classes of application (doesn't have dependence)
- Concrete classes of an abstract application. Defines commonly concrete classes of an abstract application (have dependence with logic level #2)
- Concrete (final) application classes. Defines our finally classes for the concrete application model (have dependence with logic level #3 and #2)
- abstract MVC architecture of application. Defines abstraction for our concrete MVC application (doesn't have dependence)
concrete MVC architecture of application: concrete controller, views, models. Concrete application workflow (MVC: views as view, models as proxies, controller to link both)
- Models are simple Proxies that work with level #4 (dependence with #5 and #4)
- Controller and view don't know about what classes model uses (doesn't have dependence with any level, except #5).
- Model share data with view using "value objects" (defined in the logic #5)
Cars Game Application Example:
EngineUtils
,TrackUtils
and soICar
,ITrack
,IEngine
,ITrackFactory
,IEngineFactory
and soCar
,Track
,SimpleEngine
,AdvancedEngine
,EngineFactory
and so (implement interfaces of #2)HondaCar
,FordCar
,BMWCar
,TorontoTrack
,TokyoTrack
,DushanbeTrack
,KualaLumpurTrack
,TrackFactory
,SuperEngine
,ExtendedEngineFactory
and soITrackProxy
,ICarProxy
,CarVo
,TrackVo
,TrackListVo
,CarListVo
and soGameController
,TrackView
,CarView
,CarProxy
,TrackProxy
and so. Data sharing by model<->view areCarVo
,TrackVo
,TrackListVo
,CarListVo
and so
What do you think about this levels? And if its OK, Im thinking about how to separate all this levels in the project? (by namespaces or by libraries). If namespaces, then I have a problem of naming this namespaces...