Business Level Design

We are currently updating our architecture and application design. We have just completed the development of a data access layer that is common in the sense that it works using XML and reflection to save data.

Now we are at the stage of designing a business level. We read several books related to the architecture and design of the enterprise, so we found that several templates can be applied to the business layer. Example template templates for tables and domains. In addition, we also found a domain-driven project.

Earlier we decided to create Entities against table objects. But we found that there is a difference in Value and objects when it comes to DDD. For those of you who have gone through such a design. Please guide me in pattern, practice and pattern.

Thank you in advance! Also, please feel free to discuss if you did not have any points.

+4
source share
3 answers

@Adil, this is not an answer to your initial question, but I would advise you to reconsider your decision to minimize your own level of data access. Note that you want to upgrade to NHibernate: just do it now.

IMO, writing OPM is a waste of time unless you have special restrictions. There are many options, and hundreds of hours of effort have already poured into them. Use it! LINQ2SQL, Entity framework, NHibernate, Subsonic, LLBLGen - all is well, and there are more of them.

Please note that if you give up your own, you cannot use the good, which is LINQ, without much effort.

As for layers, try not to fade: keep the number of layers under control and focus instead on building a standing interface between them to protect against leakage of abstractions.

I saw a number of very β€œpatterned”, beautifully multi-level projects that end up in logic everywhere, and abstractions of perseverance trickle down everywhere. Keep it simple!

+3
source

CSLA.NET works great as a base for the business layer.

0
source

@Adil,

I am not a very experienced user, in any case, this is the model I use (also with NHibernate).

GUI - with all web forms, etc. BLL - directories responsible for creating instances of new DAL objects - a place where classes responsible for interacting with NHibernate are implemented. NHibernate mapping files are displayed here.

Model - A class library that is used by BLL and DAL for a data transfer object between them.

Different patterns are used. For example, BLL and DAL have a Factory class that allows access to an interface. Directories are Singleton classes. All directories are accessible through the Singleton workshop, which represents my main business logic object (for example, "Enterprise" => "Enterprise.PeopleCatalog".

Anyway, hope this helps ...

@AngryHacker, thanks for the help, could you give an example of CSLA.NET?

0
source

Source: https://habr.com/ru/post/1310822/


All Articles