I researched this for several weeks. I am currently developing a poorly coupled architecture design using the n-tier (three-layer) method and factory. My goal is to put each client business logic (ClientA.DLL, ClientB.DLL) in separate namespaces so that the project is scaled, which means that I can change / delete / add specific client business logic without affecting others, because they are independent of each other. Then I call the client namespaces / class using a unique client identifier (a string value that is supported in the database) through the factory namespace. Factory.DLL also hides the logic of each client, and BusinessAbstract.DLL serves as a layout or template that classes for each client will use.
Here is the project solution:

And here is the actual code:
BusinessAbstract.DLL
namespace BusinessAbstract {
Client implementation of AbstractBusinessRule
ClientA.DLL
namespace ClientA { public class _Member : BusinessAbstract.Member { public override void Add() { throw new NotImplementedException(); } public override void Edit() { throw new NotImplementedException(); } public override void Delete() { throw new NotImplementedException(); } public override string GetClientBLL() { return "ClientA Method"; } } }
Factory
Factory.DLL
public static class Invoker { public static T GetMemberInstance<T>(string clientCode) where T : Member, IMaintainable { Type objType = Type.GetType(clientCode + "._Member," + clientCode); return (T)Activator.CreateInstance(objType); } }
Presentation example implementation
Web site
protected void Page_Load(object sender, EventArgs e) {
And you will also notice that I have a DAL folder in each of the client DLLs, as well as an AbstractBusinessRule DLL, because I also want to scale the DAL layer and use the "UI-BLL-DAL" layer structure.
Any comments / suggestions about this design are welcome. I hope to receive information on how I can improve this structure. Thanks in advance.
CSharpNoob
source share