I ran into a design problem that I just cannot solve in a satisfactory way. I have a class library assembly that contains all of my common ORM objects (using the EntitySpaces framework). These objects are used in two or more different applications, so they are in their own assembly. This setting worked great for me for over 4 years.
I also have several applications built on the Composite Application Block (CAB) from the Microsoft Patterns and Practices (P & P) group. Yes, I know that itโs really old, but Iโm a part-time developer, one person-shop, and I canโt afford to update all the current frameworks.
This is where my problem lies: I train my OO design skills and whenever I do substantial refactoring, I try to move from a procedural approach to a higher OO approach. Of course, the main aspect of OO design is that operations come close to the data they work with, which means that my ORM objects must have functionality added to them where necessary. This proves the real head scraper, when I also believe that I use the P & P Object Builder DI container inside the CAB, and most of the functions that I will move to the ORM objects will need access to the services, / p>
In other words, let's say I have a common business object called "Face" (the original, I know), and I have two applications that USE different things with a person. Appendix A provides a set of services for which a Person must have a DI'ed so that it can use some of the methods that are currently clogged at all service levels. Appendix B also has a different set of services that IT must have DI'ed in the person object.
Given how the P&P Object Builder resolves dependencies using attribute decoration and type reflection, I donโt see how I can do this. In general, I have a common object, which when used in various applications, I will need to enter dependencies so that it can perform certain operations specific to this application.
The only approach I can come up with is to inherit a new application type A and B from the Person object. Then I will add my non-general functions and DI code to this specialized specialized Person object. Now when I write that it seems so obvious, however it is still my only solution that I can come up with and I wanted to ask here, does anyone have any other solution that they would like to offer?
One of the problems that I would encounter with my solution is that I can see how I am in naming my inherited type - I mean ... this is a person, so what else would you name? In any case, I hope you will have some ideas for me.
In addition, Iโm not sure about the current technologies that are and really, frankly, itโs hardly possible to understand the ones that I am currently using. Therefore, if I said something contradictory or confusing, I hope you can understand enough from the rest of the message to get what I ask.