Why do we need design patterns?

Why layer-based design pattern?


Business Logic — Model

  • Domain Driven Design(DDD): In short, it is a design that suggests building business logic oriented classes. It aims avoiding technical terms and structures, so that classes will depend on the workflow terminology. In this way everyone who has domain knowledge can more easily understand the work done by the business logic in the project. Thus it helps strengthening the communication between the product experts and the development team.
  • Primitive Obsession: It is an anti-pattern which can be described as the use of primitives instead of small objects for simple concepts. Let’s assume that we are storing password entered by the user. We usually store this information in the String type. But in fact the password has more properties than the String type. Assume that based on business rules the password must be at least 6 character long and must include one numeric character. These are verification rules that do not exist in the String type itself. In other words, a separate type must be defined in which the rules and properties of the password concept are defined.

UI Logic — View-ViewModel



Communication Between Layers



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store