Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Bit of an odd statement.</p> <p>You define your requirements, and then select the tools that meet those requirements, not the other way around.</p> <p>Datamapper is an ORM, an Object Relational Mapper. In this case one that follows the Active Record design pattern (do not confuse this with CI's AR, which is no active record, it's a query builder). It will map a data entity (in this case a record in an RDBMS table) to an object, and it is aware of the relationships between those objects.</p> <p>It is what an ORM does. Is it slower than using PHP's native functions to directly access the database? Absolutely. Any level of abstraction added will add processing time.</p> <p>It is not the goal of an ORM to be the fastest in data manipulation, it is the goal to abstract your data manipulation from your controller logic, which makes it easier and quicker to write applications, and absolutely faster to maintain such applications. As in a business context time == money, this is where the benefits are. If you code for free and run your code on a two-bit shared host, then maybe an ORM is not for you.</p> <p>Also, an ORM is not a swiss army knife. It is designed for a specific purpose, which is an object oriented approach to data collections, and to manipulate those collections and their relationships. </p> <p>Do not use it if it is not the correct tool for the job. If you need to mass update a million records based on some weird criteria, write a native SQL query instead. Do that in a custom model method to keep your data manipulation code abstracted from your controller.</p> <p>As to your specific comments:</p> <ul> <li>Datamapper is slow: Compared to what?</li> <li>It is not configurable: See <a href="http://datamapper.wanwizard.eu/pages/config.html">http://datamapper.wanwizard.eu/pages/config.html</a>.</li> <li>It loads the entire table: If you get() the entire table, yes. doesn't seem odd to me.</li> <li>If you create two objects with the same data, it saves twice: Yes. Same if you run the same UPDATE query twice.</li> <li>It is not suited for large databases: I have Datamapper backed applications with terabyte size databases, so I don't see the relation to size.</li> <li>It is not fast: See answer nr. 1.</li> </ul> <p>If you are a professional web designer, you should be aware of the proper way to design and build an application using an MVC architecture, and use the right toolset for the job so that you can deliver an application to your client in a timely fasion. </p> <p>time == money, and if you can deliver faster, and you can maintain or improve faster, you'll retain your customers. An ORM can help you with that. But do not use it for what it is not meant to do.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload