Hi guys,
I just reviewed the design of a project I am working on at the moment and a software design related question raised...
If I can save data from a form to a database through data access classes or whatevar, and I can display data from the database,
WHY would I need an Object/Relational Mapping layer e.g. why would I need to translate data and tables from the database in to classes and objects?
Because even if it is good practice and usually needed, wouldn't it be redundant having a conversion in both direction for no use at all like in the case above described?
I would like to know what do you guys think about it and please tell me if I should post this thread in any other forum as well.
Thank you in advance for your help.
Silh

ORMs exist to make the life of a developer easier, so you aren't manually dealing with physical resultsets from mysql_fetch_array all the time.

Also, having an ORM allows you to attach functions to certain objects ie., you want to be able to perform drawCircle on every Circle saved to the database.

In the end it is just good OOP practice, allows for code reuse, code maintainability, and ease of expansion.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.