• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

OOD and database schema

 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This is a bit abstract and opened ended as a question.
How do the OOD of code and the DB schema fit together?
Are most programmers involved in designing the DB structure or writing code for preexisting schema?
Dave/Andy
Are there techniques/principles that can improve the quality of code that is forced to interact with poorly designed DB or code for that matter?
 
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Andrew,
This is a great question.All the posts till now (to my knowledge ), were referring to designs for the middle tier or GUI (presentation tier).I am glad you came up with a post which talks about OOD in the DB tier?
So Dave/Andy, are there any design patterns which govern designs for the DB?
If there are, are they going to replace Normalization, E-R Diagrams etc. for DB designs.
Thanks,
Sandeep
[This message has been edited by Desai Sandeep (edited May 23, 2001).]
 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Andrew Shafer:

How do the OOD of code and the DB schema fit together?


Along that line, is the question different when using OO DBs than when using relational ones? I don't know much about OO DBs; can you simply extend your object model to them?

--Mark
[email protected]
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Andrew:
I assume that you are referring to relational, network etc. DBMSes, generally not object DBMS. IMHO: Ideal solutions (from design and development point of view) are Object DBMSes like JDataStore, POET (or whatever it is called now � FastObjects ?). Then the integration problem dose not exists. When you consider relational databases (which has upper hand from maturity and market share perspective) there is certainly a need for building a bridge between object and relational representation. There would be two options. One is to buy ready solution another is to develop custom one. The Product I know of is TopLink, currently offered by webgain. As far as patterns and methodologies goes, I think I have seen a chapter about persistent framework in Mr. Larman's "Applying UML and.", where he talks about problems like: (De) Materialization, serialization of complex objects, use of brokers, OIP (Object Identifier Pattern) etc.
[This message has been edited by Michal Harezlak (edited May 23, 2001).]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using a relational database instead of an object databse, ideally you would want to use a persistence engine that maps each db table row to a java object. This object to relational mapping would allow you to just work with objects.
Scott Ambler has some good white papers on his website http://www.ambysoft.com/ and the two articles of interest are:
Mapping Objects to Relational Databases: What You Need to Know and Why http://www-106.ibm.com/developerworks/library/mapping-to-rdb/
Tips for Mapping Objects to Relational Databases http://www.ambysoft.com/mappingObjects.html
Here is the first paragraph in his article at the ibm website that I feel is relevant to the topic of this discussion.


Why a paper about mapping objects to relational databases? Because of the "impedance mismatch" between the object paradigm and the relational paradigm. The object paradigm is based on software engineering principles such as coupling, cohesion, and encapsulation, whereas the relational paradigm is based on mathematical principles, particularly those of set theory. The two different theoretical foundations lead to different strengths and weaknesses. Furthermore, the object paradigm is focused on building applications out of objects that have both data and behavior, whereas the relational paradigm is focused on storing data. The "impedance mismatch" comes into play when you look at the preferred approach to access: with the object paradigm you traverse objects via their relationships, whereas with the relational paradigm you duplicate data to join the rows in tables. This fundamental difference results in a less-than-ideal combination of the two paradigms, but then, a few hitches are to be expected. One of the secrets of success for mapping objects to relational databases is to understand both paradigms and their differences, and then make intelligent trade-offs based on that knowledge.


A couple of open source object-relational persistence engines are: http://osage.sourceforge.net/ and http://castor.exolab.org/
A couple of commercial OR mapping tools are:
CocoBase - an OR mapping tool by Thought Inc. http://www.thoughtinc.com/cber_index.html
Webgain Toplink OR mapping by Webgain http://www.webgain.com/Products/toplink/toplink_Overview.html
Eddy
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My question may sound stupid - but can someone clarify if UML modelling for the DB is an alternative to the RDBMS techniques of Normalization, E-R diagram, etc?
Thanks in advance,
Sandeep
 
Hang a left on main. Then read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic