Stubborn I mean that a structure blocks you to follow certain conventions, technologies or architectures. Something like Rails or Django. This will make it possible to create deeply integrated plugins.
One of the main advantages of using Rails / Django is gems / plugins. As you know, you will find a gem for everything: admin pages, authentication, comments, rich helpers, etc.
Currently, MVC can mimic this behavior to some extent using a DLL. However, as far as I know, MVC does not have a standard architecture that allows plugins to be deeply integrated - for example, we cannot have a comment system, because you need a repository to save comments, and a typical MVC project can be using L2S โโ/ EF / NHibernate / MongoDB /etc.
It seems to me that a good way to do this is:
- Create a central core project using MEF
- The main engine will show:
- Container / Service Location
- Multiple interfaces (e.g. IRepository)
- Some hooks, such as ApplicationStart, plus every other hook / event you can think of
- What else?
- To use this
- Add a link to the "core engine" binary
- Define some configurations (the example will be an instance of IRepository)
- Now the developer can include any plugin that depends on the "main core", and these plugins will have full access to the events and application repositories
- Obviously, plugin developers will develop plugins aimed at the main engine - they never talk directly to the application, and the engine is the average product between them.
The goal is not to have the perfect corporate web infrastructure ... but instead you need to build something like what Django and Rails have, and MVC does not seem to be there: the high repetition of using heavy but popular components.
Has this been done before? Is there a better way to do this?
Anaimi
source share