A baseline for domain driven Xamarin applications using an Onion Architecture.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Components
Core.Application
Core.Domain
Dependencies
Infrastructure.Data
Infrastructure.IoC
Infrastructure.SQLite
Presentation.iOS
.gitignore
LICENSE.md
README.md
xDriven.sln

README.md

xDriven

A base framework for Xamarin cross-platform solutions.

This framework is under heavy construction currently...

Onion Architecture

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.

Cross-platform Patterns

Presenters
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.

Persisted Context
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.

Home-grown Injection
A singleton pattern to inject interface implementations (...until there's a good Xamarin port for Ninject ;).

Solution Structure

Core

  • Application
    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
    Domain namespace containing a sensible entity base as well as a generic repository interface. This layer has no dependencies.

Infrastructure

  • IoC
    This is where dependency resolution resides. It currently contains one namespace, SQLite, that handles resolving SQLite repositories.
  • SQLite
    This contains the SQLiteNET library. The one repository included implements the generic 'IRepository' interface and covers most use cases.

Presentation

  • iOS
    Everything iOS specific. Anything beyond creation and placement of UI elements should fall back to a corresponding Presenter in Core.Application.
  • Android
    Everything Android specific. Anything beyond creation and placement of UI elements should fall back to a corresponding Presenter in Core.Application.

Solution Items

  • README.md
  • LICENSE
  • .gitignore

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... :)