Re: Object-oriented thinking in SQL context?

From: Bernard Peek <bap_at_shrdlu.com>
Date: Tue, 9 Jun 2009 23:23:05 +0100
Message-ID: <wcGHVurJDuLKFwN0_at_shrdlu.com>


In message <4a2edac9$0$27727$703f8584_at_news.kpn.nl>, none <rp_at_raampje.?.invalid> writes
>>> I am not aware of any precisely and consensually OO defined concept.
>>> I have asked hundreds of OO programmers in the past about a definition
>>> about what an object and each of them came with a totally different
>>> definition.
>
>But it's pretty much clear what a UML class diagram is, isn't it.
>
>>You are a database desinger, right? Do you ever use the
>>'entity-relation' method when you design a database?
>>If so, what is an 'entity'?
>
>The entity-relationship method is often used, advocated and taught
>for the design of databases. The design starts by creating
>an entity-relationship diagram, that is systematically transformed
>and provided with implementation detail until an ER diagram results
>that specifies a relational database schema.
>
>An ER diagram is a representation of the relations (tables)
>and foreign key relationships in a relational database schema.

That's the physical data structure which describes the way the database has been built. That's often derived from the logical (and sometimes a separate conceptual) data structure. That's where the objects on the diagrams are entities. Entities and tables are not the same thing.

The ERD is an entity relationship diagram which details the logical or conceptual structure which is then used as a basis for a physical design.

Entities loosely map to classes in that there are instances of each entity which vaguely map to objects as instances of a class.

One thing to be aware of is that different design methodologies use entities and ERDs in slightly different ways. Some have the concept of a sub-entity, others don't.

-- 
Bernard Peek
Received on Wed Jun 10 2009 - 00:23:05 CEST

Original text of this message