How To Handle Communication Between the Domain and Database Layers?

前端 未结 4 588
日久生厌
日久生厌 2020-12-18 17:15

I am fairly new to using separate layers for the business logic (Domain) and database access logic, but in the course of working things out I\'ve come across a problem to wh

4条回答
  •  醉梦人生
    2020-12-18 17:55

    Many systems employ an independent data layer to handle persistence to and from a database. There are several models for the organization of such a layer. Some use a sort of factory-like implementation, others employ a one-to-one mapping with one data layer class per domain class.

    The model for the data layer often depends on style and preference. What is important is separating the persistence layer from the domain layer. I believe there are tools out there that will help you generate this layer, but my PHP knowledge is thin so I can't name any specifically for PHP.

提交回复
热议问题