When working with Domain Objects, you shouldn’t need to know how the object is implemented, the interface should tell you everything you need to know. Once this knowledge is encapsulated as an object, the outside world should not need to worry about the internal implementation of those business rules. The process of encapsulating your application’s business rules involves truly understanding the concept and how the business expects it to work at a fundamental level. ![]() The business rules of the organisation should be enforced through objects that protect the invariants of the concept they are modelling. In today’s article we will be looking at the patterns from the book, and how to use them in your day-to-day projects.Īn important lesson from Domain Driven Design is the encapsulation of Domain logic in objects. Writing rigid code that is not able to evolve will grind this process of discovery to a halt. One of the most important aspects of Domain Driven Development is the ability to constantly refactor your code through an iterative process of discovery. In Domain-driven Design: Tackling Complexity in the Heart of Software, Eric Evans highlights a number of patterns and techniques to help to prevent you from falling into this trap. In reality, we are all still writing crappy code today that we will have to maintain tomorrow. With all of these patterns, principles and philosophies, you would think that as an industry we would have cracked this problem. A lot of them even have easy to remember acronyms (DRY, SOLID, YAGNI). There are many teachings in the world of software development that all focus on preventing us from falling into this trap. However always with the best of intentions, even the most diligent developer can fall into the trap of writing code that is difficult to maintain. No one sets out to write code that is scary to work with, difficult to understand or impossible to change. Starting from a clean slate is like a breath of fresh air.Īll software development projects start with the best of intentions. ![]() I’m sure we’ve all worked on projects that are riddled with legacy code that is scary to touch. One of the most beautiful things in software development is starting from a clean slate. ![]() 6 Principles for Writing Maintainable Code
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |