Use abstract factory or generic factory and extern assembly? RRS feed

  • Question

  • 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.

    The base project is pretty much an factory which loads the system application assembly based on configuration string.
    The thing is that the application may/will have customer specific adjustments and i don't want to put this code in the 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 write more customer specific code without rewriting the system application assembly.

    The idea is to have one base dll, one application dll and then put customer specific adjustments in one dll.

    is the factory which loads configuration defined system application, BigSystem, Rob.Application.BigSystem.dll, the system application should contain a set of managers inherited from Rob.Core.dll.
    Rob.Application.BigSystem.dll should check if this customer, BigCompany, has unique adjustments and if so loads the Rob.Application.Customer.BigCompany.dll assembly which may contain overrides of methods or extensions of objects, extra fields etc.

    Well, time to summarize...
    • Which type of factory in base assembly should be used, abstract or generic.
    • Base classes should be abstract classes and methods?
    • Methods in base classes takes interfaces as input parameters?
    • How to extend base interfaces in customer adjustments and how to get the system application use this customer adjusted interfaces?

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

    Best regards

    Friday, March 13, 2009 1:14 PM

All replies

  • Hi Rob1624154,

    Some Points

    • You need to use need define a abstract class in the base assembly. In the abstract class you need method that your functionality requirement.
    • When you new customer requirments comes , you can add the method to the base class which is an abstract class. You need to override these methods in the derived class, which contain the custom functionality.  By doing so we are improving the flexibility of entire module , more new requirements we can add new methods to the base abstract class  and then add the custom functionality to the derived class as we move add in the development.
    • I would suggest define define abstract class for base functionalities. You need to added methods to the base abstract classes. 
    • When interface is passed as method parameter , you can think about the using ref along with interface methods.

    Some links

    Should I use an abstract class or an interface?

    Regarding Software Architecture.

     Building the software architecture , you need identify the various blocks of your entire application.  Then you need to think about the whether the appliation should give importance to scalability or performance.  You need peformance risk analysis of system architecture, this step is very important.


    Saturday, March 14, 2009 9:13 AM
  • Hi PHIJO,

    Thank you for your reply and sorry for my late response.

    Your suggestions seems fair and it looks as if it could work.
    I'm about to create some test projects just to see if this is the right way to go.

    Monday, March 16, 2009 3:19 PM