I've been developing a database that I created from scratch, with a large number of entities and numerous vba procedures in it, for a while now. I've become comfortable with the concept of normalized database design and also with writing procedural VBA code.
I believe I understand the basic idea behind object-oriented programming. It is a world of objects that have internal workings and that interact with each other via interfaces. I haven't truly operated in such a world, but I believe I get the basic differences between procedural approach (subs and functions that call each other) versus an object oriented approach (objects with internal subs and functions, interacting with each other).
I'm wondering how database entities translate into objects in an OOP environment. There's an undeniable resemblance between the properties of an object and the fields (or attributes) of a database entity. From the outset, it seems like all database entities (like the people table) can be translated into objects (like the person object). Facts about a person (like date of birth) can be read from the database while initializing the object, and the object can calculate additional properties (like age) that are derived from those facts.
I'm curious about your experiences about applying/using the object-oriented approach to work a database. Do you write classes the way you design tables? Do you use inheritance to relate objects, or write new classes to represent a record of a query, perhaps? What do you use to represent relationships? Have you experienced Object-relational impedance mismatch ? What dictates design, i.e. do you design the database to suit your objects or do you design objects to suit the database?
I believe I understand the basic idea behind object-oriented programming. It is a world of objects that have internal workings and that interact with each other via interfaces. I haven't truly operated in such a world, but I believe I get the basic differences between procedural approach (subs and functions that call each other) versus an object oriented approach (objects with internal subs and functions, interacting with each other).
I'm wondering how database entities translate into objects in an OOP environment. There's an undeniable resemblance between the properties of an object and the fields (or attributes) of a database entity. From the outset, it seems like all database entities (like the people table) can be translated into objects (like the person object). Facts about a person (like date of birth) can be read from the database while initializing the object, and the object can calculate additional properties (like age) that are derived from those facts.
I'm curious about your experiences about applying/using the object-oriented approach to work a database. Do you write classes the way you design tables? Do you use inheritance to relate objects, or write new classes to represent a record of a query, perhaps? What do you use to represent relationships? Have you experienced Object-relational impedance mismatch ? What dictates design, i.e. do you design the database to suit your objects or do you design objects to suit the database?