views:

84

answers:

1

Hi,

I´m having some trouble deciding in which way to go...
I've got this application which consists of one base project, and one project for the application, the application project contains code targeting a specific system, system application.

The base project is an abstract class containing abstract methods which each system specific application project implements.
The thing is that the system application projects may/will have customer specific adjustments and i don't want to put this code in the system application assembly.

I´m not sure where to start or how to accomplish this in a way that is secured for the future, easy to maintain and were i can add more customer specific code without rewriting the system application assembly.

The idea is to have one base project (dll), one system application project for each system (dll) and then put customer specific adjustments in one customer unique project (dll).
Rob.Core.dll
Rob.Application.BigSystem.dll
Rob.Application.BigSystem.Customer.BigCompany.dll

Rob.Core.dll is the base abstract project.
Rob.Application.BigSystem.dll is an system specific project (BigSystem) and derives from Rob.Core.dll.
Rob.Application.BigSystem.dll should check if the current customer, BigCompany, has any unique adjustments and if so load the Rob.Application.BigSystem.Customer.BigCompany.dll assembly which may contain overrides of methods or extensions of objects, extra fields etc.

Well, time to summarize...
Im not sure which way to go here, i could create one base project (abstract) and from each system specific project derive from this, seems as this is the way to start.
Then create a new project for each customer that has a set of unique adjustments and just override all methods in the system specific project.
The problem is then, which project is the one that executes on runtime? The system specific project or the customer unique project?
If the system specific project executes how should it load all the customer adjustments (if there are any, not every customer got unique adjustments)?

This is quite a big question but i'm hoping in some tips which will help me write the architecture.

Best regards
Robert

A: 

My two suggestions, from what you said:

I would focus on types, not projects. "Projects" are just a way to create an assembly full of usable types - they don't, in and of themselves, inherit anything, nor do they allow for subclassing, etc. The questions I would be asking: What types would need to be customized for a customer? How would this customization take place?

Once you have those figured out - I would suggest looking into depedency injection or extensibility frameworks. A good DI framework to try would be Ninject. A good extensibility framework is MEF.

If the types will always need to be supplied in a customer-specific manner, then you probably want to focus on DI. If the types are something that will be an optional extension to the default behavior, then just doing some form of plugin system/extensibility system like MEF may be simpler.

Reed Copsey
Mmm, got some of the terminilogy wrong up there... Well, lets say that my core assembly contains a class (type) containing abstract methods for Login and Logout. The system specific assembly inherits this class (type) and implements Login and Logout, these methods are coded for the specified system. Next, customer #1 comes along and wants extra functionality when the Login is called, Logout is untouched. One solution is to load the customer unique assembly by a setting (app.config or similar) from the application assembly. But it should be some better way of doing this...
Robert
@Robert: Take a look at MEF - this is a good candidate for extensibility. With MEF, you could have it so you drop the DLL in a subfolder, and if it implements a specific type, the system just finds it and "injects" the extra functionality into the application. It's all just a matter of defining where and how the types can be extended...
Reed Copsey
@Reed: I´ll do that and post my results!
Robert
@Reed: I´ve done some testing now and must say it´s a competent library and it seems as if this will solve my troubles. Thanks a lot!
Robert