Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Where is the separation of logic if the business entity knows both the business logic and has knowledge of the structure of the associated data storage mechanism?

0
Posted

Where is the separation of logic if the business entity knows both the business logic and has knowledge of the structure of the associated data storage mechanism?

0

Each database table class contains both business rules in the form of custom code and a description of the table’s physical structure as described in the $fieldspec array. By containing all this information within a single class I am adhering to one of the fundamental principles of OOP which is encapsulation. Although this information is defined within a business object it is not used to access the persistent data store (i.e. database) until it is passed to my Data Access Object (DML class). This uses the information given to it – the table structure and some data – to construct the relevant query and then pass it to the specified database engine via the relevant API. There is nothing in the principles of OOP that says I cannot define information in one object, then pass it to another for processing. It is where this information is actually processed which is important.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123