Link to home
Start Free TrialLog in
Avatar of alevin16
alevin16Flag for United States of America

asked on

Object Model vs Data Model

Hello All

I was hoping someone could explain Object Model vs Data Model to me on a simple level.  Here is a situation we are in.  I have an Access database that is linked to another program (ODBC connection) so that I can add/edit/delete data in the other program.  I was told the way I am doing this is the data model and that I should be connecting via an object model (sorry if I am using the terms wrong).

From what little research I did it looks as if the object model just does more data validation than the data model (and that the object model deals with business logic).  Could I actually be interacting with this other program like an object model because on my forms I include all the code that handles the business logic.

Once again I am sorry if I sound like an idiot by using the terms wrong but I be just a simple Access programmer.

Thanks
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

on a High Level the Data Model simply spells out the tables and the fields within those tables.

The object model is more about the object oriented side of things (eg: classes and what not).

So for example:

you might have a table called vehicles in your database.
Vehicles
   VehicleType (int)
   NumWheels (int)

The object model could have a base class:
Vehicle

with Car inheriting from Vehicle
and Truck also inheriting from Vehicle.

They might be implemented completely different, but still refer back to the vehicle table in data model.


I hope that helps.
Avatar of alevin16

ASKER

I like how you explained the data model in high level (it really helped!), but I have a question.  Would the VBA programming I did for the forms be the business logic?  I see how the Data Model would define a particular field as text but the VBA programming I did could restrict entry to be an email address (as an example), so would this be more like the Object Model?  

Sorry again for the confusion.  You really are helping me understand it! (I have to admit though that I really do NO Object Oriented Programming)

Thanks again!!
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
WOW where were you a few years ago when I walked out of a class on this.  I could have used you!  This is becoming very clear and I am really happy you are putting up with my "stupid" questions.

Ok so let me ask you this.  I connect to that program (I mentioned before) via Access (ODBC) there are people working on another program and they are telling the boss that their program is superior because it uses the Object Model to access and work with the data.  They say their method keeps the data in that main program "pure" and "clean" as opposed to mine.  If I use VBA to restrict what data goes into a particular field am I not doing the same thing but just in a different place?  As you say you have everything in your class (which probably makes it a hell of a lot easier to fix when things go wrong) and I just have it all in the code of the form.

The boss is the kind of guy who gets suckered into new and shiny things.  I have no clue how this man makes his money (he is the owner and a multimillionaire).  

Thank you again!
Andy
I hear you.

Yes you are essentially doing the same thing.  Again, whether the business rules are implemented in the "data layer" or "object layer" as long as they are implemented correctly at the end of the day it doesn't really matter.  (There are pros and cons for each).

I would first test the hell out of it and challenge them to break the form and insert bad data.

The only other caviat I would throw out there is if someone could bypass your VBA somehow . . . I know there were ways of compiling the project as an add-in or stand alone running app so that it would be less probably someone could do this.

If you have any other questions feel free to ask.  If not then good luck with your boss :-).
Thank you thank you thank you!!!!  This was GREAT!
I've requested that this question be closed as follows:

Accepted answer: 0 points for alevin16's comment #a40228105

for the following reason:

This was terrific!  The answers were explained in a way I could understand and he was extremely patient with my questions.  I cannot thank him enough!
I am sorry about that.  I did not realize that.  Yes he is the one who should get the credit and the points
Thanks all.