Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hey,

I'm trying to write a modular application framework, which consist of many modules, designed to be re-used in multiple different projects. Such as, interfaces to social networks, authentication using those interfaces, etc.

Obviously, every module in the system might need access to the storage to keep its persistent data, and have its own Bounded Context (containing only the entities that it require to function, in order not to have redundant dependencies).

I would like the entire database to be migratable (I thought about creating a dynamic mega-context during run-time and use it for migration, not sure if that would work... )

There are intersections between contexts (I've seen that there was a certain improvement introduced in EF6, but I think that it applies for independent models only, Am I wrong?)

-------------------------------------------------------------

This is the ideas I'm trying to achieve with my design, for an authentication context and contained entities (every module has its own bounded context):

- The basic entity is an Authentication Identity Entity. (represents a registered system user).
(*) Contains a unique user identifier.
(*) Maybe contains (or linked to) some generic meta-data about last logins.

- Module-Specific Authentiation Record(s) (Every module implements its own entities)
(*) Linked to an Authentication Identity Entity.
(*) Contains the required metadata for the module (Email & Password, Facebook Id & Access Token, etc.)

--------------------------------------------------------------

An application could then define its own logic, without caring about what authentication methods are supported, and which of them are used to identify the user. That's because a user is minimally-identified by a generic Authentication Identity entity, and not by the entire authentication metadata.

Moreover, If a certain application logic would like to use a certain authentication record (i.e. access user's Facebook information), it could simply create a bounded context that would contain the entities it needs (after all, there is a dependency anyway...)

Questions Time:

Does my design make sense? Is it even achieveable considering Entity Framework's current limitations with multiple bounded contexts? I would really appreciate any answer. I would be most grateful for any code snippets / reference that would show me how to implement this properly.

By the way, this is a new project, and no project is using it (yet...) If Entity Framework is not the answer, What ORM would you recommend to fulfill my requirements?

Thank you very much for your assistance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900