Recently, I came into contact with a website. The designers thought of the business object as an entitybase-class simpleentity and complexentity. simpleentity had many properties and complexentity was merged by many profile classes, each profile has many properties. Most specifically, the attribution relationship between complexentity and profile objects is associated with an attribute of the profile object.
This design seems very flexible, but I personally keep my opinion on it. There are three reasons:
I. the complex relationship between business objects should be avoided as much as possible. Here, splitting a business object into multiple profiles seems to aggravate the complexity of the class relationship and the expansion of the number of classes.
2. a property of the profile object is associated with the complexentity class, instead of directly containing the profile object set by the complexentity class. In this way, the entire object (including the profile and complexentity) can only be obtained through reflection, in this case, there may be problems with efficiency (not demonstrated ).
3. dispersed the attributes of a logical object into N profile objects (n data tables will be created after nhib.pdf persistence ), the query efficiency of attributes across profile objects may be affected.
For some flexibility, the above three questions are not minor. How is this design?