Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sorry it's taken so long to come back to you. What you are asking is not specific to Objective-C. My first introduction of connecting Object-oriented code to RDBMS was Enterprise Object Frameworks in NextStep. But since then, that idea has been copied in most object-oriented languages including Java and Ruby (see ActiveRecord).</p> <p>Conceptually, on the programming side there is usually a entity class that is used to represent each row of a table. In some cases, such as CoreData or WebObjects, a map is used to create an interface between the application code and the database. Because of this map, a developer can use instances of the generic entity class to represent the data. Of course, many times that class is subclassed to added methods specific to a particular entity.</p> <p>For example, say you have a table for contacts, which has a column for first name and a column for last name. Often in an application you want to display the full name. In a subclass of the entity class, one can add a method that returns the first and last name as a single string.</p> <p>In other frameworks, such as ActiveRecord, I believe you must always have a subclass that represents each table.</p> <p>Conceptually, I find Object-Oriented programming to align well with RDBMS.</p> <p>Table (contacts) -> Class (Contact)</p> <p>Row -> Instance of class (aContact)</p> <p>Columns (firstName) -> Properties (aka instance variables, attributes) (firstName)</p> <p>Relationships:</p> <pre><code>to-one (father) -&gt; Properties (father, an instance of Contact) to-many (emailAddresses) -&gt; Array (emailAddresses, an array of instances of EmailAddress class) </code></pre> <p>Hope this answers your question better,</p>
 

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