A base framework for Xamarin cross-platform solutions.
This framework is under heavy construction currently...
This solution implements a flavor of the onion architecture framework pattern. The reasoning behind this is to allow separation of concern and modularity. This is especially useful when dealing with enterprise-level applications, but also can be applied to smaller projects. It maximizes code reusability and keeps your classes small and manageable. It also gives us the ability to swap out and re-use layers with little effort.
Keeps all non-UI related code (business rules, validation, action logic, etc...) in the Core layer so it's re-usable in all presentation layers.
Persist the application context / settings using the data layer (SQLite in this case), making it available for use in all presentation layers. We hydrate a singleton that holds the context data, and use a service to save / load.
A singleton pattern to inject interface implementations (...until there's a good Xamarin port for Ninject ;).
Core contains the meat and potatoes of the application, including cross-platform stuff (like application context, presenters, broadcasters / events, and services). This also contains the Injector singleton used to register and resolve interfaces. The one and only dependency this project has is the Domain layer.
Domain namespace containing a sensible entity base as well as a generic repository interface. This layer has no dependencies.
This is where dependency resolution resides. It currently contains one namespace, SQLite, that handles resolving SQLite repositories.
This contains the SQLiteNET library. The one repository included implements the generic 'IRepository' interface and covers most use cases.
Everything iOS specific. Anything beyond creation and placement of UI elements should fall back to a corresponding Presenter in Core.Application.
Everything Android specific. Anything beyond creation and placement of UI elements should fall back to a corresponding Presenter in Core.Application.
Items on the todo list:
- Drop in Google Analytics base
- Create demo iOS presentation layer that shows use of cross-platform code
- Add notification scheduler base
- Add reachability base
- Add controller base
- Add presentation base
- Add validation broadcaster
- Add Google Analytics usage
- Create demo Android presentation layer that shows use of cross-platform code
- ...a bunch of other stuff... :)