Best Practice for Client based Custmization in a generic Product RRS feed

  • Question

  • Hi ,

    This is basic and general question for architecture. But i am in need for best practice for this scenario. I have a layered application (4 layered). This is a generic product based on Industry type. I have 2 major constraints for this generic product like the following

    1. The product should have all the features of all industries. Based on the industry type the functionality will run. So that some functionality will hide and some other may visible.

    2. Even Industry Type is same some client may ask customization for business rules or other functionality. I have unique id for each client.

    How you develop this type of application. How you handle these situation like client based customization? Now i am rewriting the my old version of product (Not Layered) into new version (Layered ). In older version client specific is handled through a security deployment class so based on client code some functionalists is blocked using this class.

    How i handle in the new version in a better way? (Separate business layer for each client or any other method. We can't assure the changes in Business only or DAL only or Presentation only. This depends on client requirement.

    Tuesday, August 14, 2012 1:31 AM

All replies

  • You have various options here.

    If you are doing proper OO programming, best thing will be to use interfaces to define the different business rules and a factory pattern to create the right BL class depending on the client. You can use for that any of the Dependency Injection frameworks out there, Unity for example if you are programming in .Net.

    Other option, is just add switch statements based on the client around your code but this will turn quickly unmanagable.

    For point 2 in your request, the fist approach will also be the right one as you can have base classes for each industry and inherit from them in case a particular client requires a customization.

    Overall I would try to avoid naming customizations against particular clients, and try to use names based on the business rules itself, in that way if will be less weird to reuse that particular customization if other client ask for it.

    In summary:

    - Do proper OO code (SOLID)

    - Use a factory pattern to create the appropiate implementations of your interfaces in runtime

    Hope this helps!

    Juan Casanova http://jawsofdotnet.blogspot.com - My .Net babling blog

    Wednesday, August 22, 2012 6:54 AM
  • Thanks for the guidance. I am also looking into this pattern. But i need a proper guidance because i am new to this patterns. Also i need some guidance for industry wise separation also. We are not have separate edition / build for each industry
    Wednesday, August 22, 2012 10:28 AM