Mostly well designed systems usually carry four layers model. Every layer has some specific responsibilities and in good design has less dependence on other layers. Here are these layers with small description,

  • Presentation - This layer is consist of screens where user see data coming from system and has the ability to interact with it. Capabilities of presentation layer depends on the client device. If system is properly design then system can have multiple presentations without any changes in backend system.
  • Controller - This layer actually implements use cases collected at analysis stage.
  • Domain Model - This layer defines key business objects. It captures business rules as well as data requirement of the system. Data requirements translates into attributes of objects and rules usually implemented in method of objects. Rules also dictates the relationship between objects.
  • Persistence - Every system has to store its state somewhere so that it can be retrievable after system restart. Usually it stores into relational database and it can automated by the ORM (Object Relational Model) tools.

If you are working on small project, you can combine different layers, but for big projects it is better to implement these layers clearly.