How should I pass data between classes and application layers?

后端 未结 8 1783
太阳男子
太阳男子 2021-01-30 07:16

For example, if I am creating a 3 layer application (data / business / UI) and the data layer is grabbing single or multiple records. Do I convert everything from data layer in

8条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-30 07:48

    Whatever means you use to pass data between the layers of your application, just be sure that the implementation details of each layer do not leak into the others. You should be able to change how the data in the relational database is stored without modifying any of the code in the business objects layers (other than serialization of course).

    A tight coupling between the design of the business objects and the relational data model is extremely irritating and is a waste of a good RDBMS.

提交回复
热议问题