Re: 3rd REPOST:OJB:Dynamic association and Colored graph

2004-04-13 Thread Robert r. Sanders
I think you are asking a broader question. 

First, do the Colored nodes need be seperate subclasses?  why not 
ColoredNode exetends Node: { color, p1,p2,p3},
Also, are the properties actally differernt properties, or just 
different values.

I think you can store the Nodes using OJB, or any other mapping 
technique, but you will need to implement the logic (such as no two 
nodes can have the same point values) yourself - this will probably 
include custom link, and unlink methods.  Where OJB or other mapping 
techniques help a lot is allowing you to avoid writiing a buch of 
"cookie cutter" code for recursing over your Nodes and 
storing/retrieving them from the database - you just do : 
broker.store(graph) and the entire object tree is saved.

Ajitesh Das wrote:

All:
I have a design question.
Let me first describe the problem:
I like to store, update, delete, and retrieve a graph where the nodes
are colored differently - for e.g. red, blue, yellow, green, black, etc.
etc.
[A new color could be added in future]
The graph will be constructed at runtime.
My object node:
Node: { p1,p2,p3, Edges[]}
Blue_Node extends Node : { p4,p5,p6}
Red_Node extends Node: {p7,p8,p9}
 ::
And so on...
   Where pi = property i
 and pi != pj for any i and j
   During the runtime, based on input data stream, I will construct and
   store:
   Edge[Node(a) -> Node(b),wi] where wi is a weight value
   on the Edge[Node(a)->Node(b)]
  Node(a) could be blue, red, yellow, green ...color
  Node(b) could be blue, red, yellow, green ...color
   And also there can co-exist an Edge[Node(a)->Node(b), wj] where wi != wj

   I am trying to model this data structure in term of 1:n mapping table.
   Is this possible model with the following way:
   
name="allNodesInGroup"
element-class-ref="com.acme.graph.Node"
orderby="colorId"
sort="DESC"
 >

 
   and can I also use the fault or proxy object ?

   Or

   I have to deal this manually using :
   public void link(Object obj, boolean insert)
   public void unlink(Object obj)
   public boolean link(Object obj, String attributeName, boolean
   insert)
   public boolean unlink(Object obj, String attributeName)
   Thanks in advance for your help
   Regards
 Ajitesh
 

--
   Robert r. Sanders
   Chief Technologist
   iPOV
   www.ipov.net
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


3rd REPOST:OJB:Dynamic association and Colored graph

2004-04-12 Thread Ajitesh Das
 
All:
I have a design question.
Let me first describe the problem:
I like to store, update, delete, and retrieve a graph where the nodes
are colored differently - for e.g. red, blue, yellow, green, black, etc.
etc.
[A new color could be added in future]
The graph will be constructed at runtime.
My object node:
 Node: { p1,p2,p3, Edges[]}
 Blue_Node extends Node : { p4,p5,p6}
 Red_Node extends Node: {p7,p8,p9}
  ::
 And so on...

Where pi = property i
  and pi != pj for any i and j

During the runtime, based on input data stream, I will construct and
store:
Edge[Node(a) -> Node(b),wi] where wi is a weight value
on the Edge[Node(a)->Node(b)]
   Node(a) could be blue, red, yellow, green ...color
   Node(b) could be blue, red, yellow, green ...color
And also there can co-exist an Edge[Node(a)->Node(b), wj] where wi != wj
 
I am trying to model this data structure in term of 1:n mapping table.
Is this possible model with the following way:

 
  
and can I also use the fault or proxy object ?

Or

I have to deal this manually using :
public void link(Object obj, boolean insert)
public void unlink(Object obj)
public boolean link(Object obj, String attributeName, boolean
insert)
public boolean unlink(Object obj, String attributeName)

Thanks in advance for your help
Regards
  Ajitesh