Common enterprise architectures
Common enterprise architectures
Some patterns I’ve usually encountered while working code bases written by .net developers. You can also read more on msdn.
Domain driven design inspired
Usually you find classes with postfix name like:
- Repository : List like interface for working with persisted data. Usually state of fetched objects is tracked, so you can do
customerContext.Save()to persist changes to objects. - Service
Related concepts
People are often confused by “Unit of work” also mentioned in connection to these patterns. Many OR-mappers implement the repository pattern. Popular libraries include Entity Framework, NHibernate and RavenDB (library and database).
Key concept
The key point of DDD is ubiquitous Language. Being able to have roughly the same type of concepts as the users can be very helpful.
DAL
This type of architecture is quite simple. The main benefit of it is that it’s easy for people to grok. This type of architecture is not as popular anymore because it increases the amount of code you have to write.
- Manager : An object that does things by using other managers and accesses the data using DAL
- DAL : Data access layer. State for fetched objects is not tracked. You have to make the DAL aware of changes
customerDAL.Update(customer); - DTO : Data transfer object.
In this type of architecture it’s not uncommon to have an additional layer in the database implemented by stored procedures.
Message queue & Service Bus
Popular choices I’ve encountered are RabbitMQ and MSMQ. A popular library is MassTransit.
Provides a way to lower cohesion between components. Can also be helpful if you want to distribute work.
Tags
Do you want to send a comment or give me a hint about any issues with a blog post: Open up an issue on GitHub.
Do you want to fix an error or add a comment published on the blog? You can do a fork of this post and do a pull request on github.
Comments
See the Microsoft docs on common web application architectures.