• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does the book cover the Object Oriented design?

 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi David and Craig and all the ranchers
How to define a object scope and seperate the object when the situation is necessary?
thanks for your attention
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can browse the book's table of contents at the O'Reilly site and judge for yourself. I doubt OOD as such is discussed. David/Craig, does the book contain tips for designing the actual object model to persist (i.e. not just which interfaces some object has to implement, etc.)?
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Lasse
And the next question is
How to define a object scope and seperate the object when the situation is necessary?
 
David Jordan
Author
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book does not describe object design. There are many other books that cover this topic. But it is true that you would need to understand object design to build good models in JDO, since its focus is on object design. Which relates to a discussion yesterday. For the many people using Java and JDBC, where they only do procedural Java and do not build object models for their persistent data, I have heard from many of these people that they never really have designed an object model before. Its sad, but its true. This question suggests the person falls into that camp.
Also, except for requiring you to have a null constructor (which can be private), JDO does not require you to use or implement any interfaces for your persistent classes.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David. I actually knew that JDO doesn't require the persisted objects to implement anything -- I just used it as a bad example trying to communicate that my question was about designing the "conceptual persistent object model", not the "Java object model for JDO."
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks David
 
Craig Russell
Author
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDO can be used with domain object models that simply contain the data (exactly like value objects) or include "business logic". It is your choice.
Some JDO tools allow you to create JDO classes from existing database schema, and these classes only contain the data and relationships. You can then add methods to these classes to enforce semantics and other business rules.
Originally posted by siu chung man:

How to define a object scope and seperate the object when the situation is necessary?
 
David Jordan
Author
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The great news about JDO is that it really does not impose any design constraints on your object model, it supports all of Java. You do have to have a null constructor, but it can be private. And fields declared static are not stored in the database. But you can use all the features of object-oriented design: encapsulation, inheritance, polymorphism, interfaces, etc. And you can persist virtually any of your classes, assuming they don't use native C code, etc.
You also don't have to build your classes up from JDO provided data types, except there are specific collections and interfaces from java.util that you must use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic