0

I'm working in a web application that has several areas of bussiness work. With time it's size has became a problem to develop on and to maintain. I would like to break the web project into several sub-projects or libraries depending on a main root web project that has the common files to share (Masterpages, Resources, Css, etc...) Ideally I would like to have some kind of injection that allows me to optionally publish that "components" or simply publish a customized variation, although it's configuration depended on after deploy DB setup.

I searched all over the web, reading all the pages related to multiple projects, dependency injection and composite apps that I could find, 'till I soften my head, but couldn't find anything really useful. Major part of the writings where a theoretical approaches or unit testing applications (well, you can't make your desired app, but you still can unit test something else) Other approaches simply don't work in VS2010 .Net 4.0

Can someone address me on a COMPLETE solution or an example? Or simply lets discuss.

We say that the solution has the following structure, with module contents already separated into directories:

Solution

      L_ Datalayer library project
      L_ Bussiness logic /common utils library project
      L_ Web project
      L_ Controls
      L_ Images
      L_ Css....
      L_ Warehouse
      L_ Sales
      Masterpages
      ...

Warehouse and Sales contains pages related to the "module"

Thanks,


I post my progress in the subject.

As per suggestion of Steven I experimented further more using MEF. Due to the lack of documentation, specially for webforms, that was a pain in*. So far I managed to implement MEF in my solution and sucessfully inserted a plugin project visible for the main app.

Then loads the available plugins, through an interface that has the plugin name, the default page url and its order, picks all this data and render a menu tab. That part it's easy.

Clicking on a menu element must redirect to the main page of the plugin, which will render several menus for its pages contained (from another export interface)

I finally got an aspx page embedded as a resource in the plugin project. Where I'm currently stuck.

¿Is there any way to render a page embedded as a resorce on a libray using MEF or I'm forced to also use a VirtualPathProvider? ¿Hows specifically the statement to redirect to that page? I've tried several ways but no-one works (MEF and VirtualPathProvider)

I looked at zillion of articles that talk about it but all them end doing control rendering, not page. So frustrating.

Sergio
  • 1,383
  • 2
  • 13
  • 28
  • I understand that you want a better separation of concerns, because this increases maintainability. But do you really need a plugin architecture? It's really hard to add new functionality to an normal LOB application with plugins. These changes will normally force you to test the complete application and is the easy of rolling out to production the most important problem you have, or is maintainability your biggest concern? – Steven Aug 24 '12 at 11:43
  • @Steven By now I'm forced to real test the application. My customer wants to use it while still developing and take profit for better suit its procedures. I'm aware of all the trouble with it, but they don't want to make it any other way. the hability of putting online separated components could avoid me to ask all the offices to quit working and only the parts related, say financial per example. – Sergio Aug 24 '12 at 14:19
  • @Steven Very unfortunate response above. I want to separate the web interface in Bussiness components for better debugging and not to compile all of it. At the same time I want the ability of having a lighter version of that "components" for swapping them and make different sets of deploys. Lighter, or more standard. Appears that customer wants to implement things that I know are inviable. – Sergio Aug 24 '12 at 16:37
  • Using an application that is under development, is called agile development, which is considered to be a descent practice. Don't try to change that. Even with a plugin architecture you would need to restart the application, so that doesn't really solve anything. You'd be better of with having multiple web services (behind a load balancer) and updating the servers one by one, to allow the users to continue working. – Steven Aug 25 '12 at 19:06
  • Since you want more maintainability, easier testing, better debugging, easier to have different deployments, I would suggest to base your architecture on the Dependency Injection pattern (read [this book](http://manning.com/seemann/)) and the [SOLID](http://en.wikipedia.org/wiki/SOLID) principles. – Steven Aug 25 '12 at 19:06

1 Answers1

0

Though it is not an answer to your question, I am adding it as answer due to length of my suggestion. I suggest you look into the approach NopCommerce is following where they have extended over .net with their own framework, which supports Plugins and extensions to existing solutions. Though I definitely know that nopcommerce is an ecommerce solution but if you study it, you can modify it according to your business needs or at least it can give you a heads on for what you should adopt while designing your solution. Hope it helps.

Furqan Hameedi
  • 4,372
  • 3
  • 27
  • 34
  • Please thank you for the formatting aid. Your where even faster than me. I did take a look at the NopCommerce solution, but found it was MVC, so I downloaded the v1.9 sources and took a peek. The fact is that I didn't found it was something useful for my application. Perhaps I use a excessive classic way of developing with masterpage-page-custom/user controls. Do you recommend me another version of the NopCommerce to look at? – Sergio Aug 24 '12 at 11:23