2

I am doing some research/exploring into different site designs and architecture. Generally speaking, I would like to read up on different patterns and practices that are being done today for web sites.

Specifically, I am looking for a composable and/or plugin site design. The main purpose of this setup would be for it to allow each plugin or part of the site to be developed independently of the other parts. Hopefully with little working knowledge of the other pieces. I know there will be some knowledge spread between the peices for authentication and authorization. The main goal would be to limit the coupling between sections of the site and limit impact of code changes to other parts of the site.

I have a few ideas but I am not sure if they are piratical. That is why I am trying to find more info on what others have done.

Some ideas.
Idea 1 was to create a MVC site that allowed plugins to be deployed. There are a few ways to do this. Seen here, here and here. Plugins could be developed and run interdependently of the main site. Once completed could be dropped in and tested with the main core. One set of master pages, CSS, and whatever else. This is similar to the plugin model for most CMS systems (ex: wordpress)

The second idea would be a single sign on design. Every section of the site could be hosted as its own domain/site/ect. but auth would be done in a sign point. Some ideas on how to do this could be seen here. Master pages, CSS and other items would probably have to be repeated between the different sections.

And the 3rd idea was a mixture of the two. The "core" site would handle styling and layout. The content would be ajax calls to the different sections of the site which could be hosted on the same domain or not.

I have not flushed these ideas out or done any prototyping yet. I am in the brainstorming portion of this process. The only thing that is set in stone is it will be written with C#/asp.net mvc and there must be only one sign in between sections of the site. Other than that, everything is fair game.

Community
  • 1
  • 1
Tony
  • 1,684
  • 1
  • 18
  • 29

2 Answers2

1

I use RazorGenerator. It's installable via NuGet (plus an install of a VS tool) and all you have to do is set the Custom Tool property on your views.

Your core site would then have to use the virtual path provider idea. You can use Chris van de Steeg's approach for this as he's already built all the code you need.

The glue that makes it all work is the third and arguably the most important point: how do allow plugins to "expose" their end points (controllers and actions)? And how do you do this in the correct context and whereabouts on your site?

For this I use a framework DLL that exposes a ton of interfaces for different scenarios. The main site creates managers for the different types of end points, and I have several layouts and helper classes that call on the managers to render the end points at the correct location. At application start-up, I iterate over all the plugin DLLs in a pre-defined directory and use reflection to inspect their interfaces, then add them to the appropriate managers.

I have also created a "management" area in the site to disable end points so that admins can override the plugin's default behavior.

As far as I know, and as evidenced by my efforts to-date, there is no pre-existing project to handle this. Hope this helps in your direction.

MisterJames
  • 3,306
  • 1
  • 30
  • 48
  • It does help. It, at its very least, shows someone else do doing something similar. – Tony Sep 06 '12 at 17:18
1

I went with idea 1 above. Here is some example code of creating a plugin site for ASP.NET MVC that doesn't no require any 3rd party references. It also includes all site content to be embedded in the plugin dll. Enjoy!

https://github.com/Oobert/ASP.NET-MVC-Plugins

Tony
  • 1,684
  • 1
  • 18
  • 29