• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

lookup tables vs interfaces

 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys :

Me and my boss had an discussion about what the best way to force standards conformance is, java interfaces or lookup tables in a database. I put this in the orm category because ORM is basically a artifact that arises because of the difference in the object vs. relational paradigms. Any thoughts on this issue ? It seems like a never ending argument...
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its an argument I'm not sure I follow! What standards are you talking about, standards in the data model, or standards in the object model? Can you explain a bit more about this discussion?
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More concretely -- here is an example.

Say you have an application where 2 different classes create a certain abstract data type that is stored in a database for retrieval at a later data. Now, assume that the evem though models create the same data type, the contents of that data type are conceptually different (for example, they both create a byte array, and but each orders the bytes differently for some reason).

Now, in order to ensure interoperability between the data type across the two models, you can put a lookup table in the database that matches the creator of the orignal data type with the ordering of its byte array OR you can force each class to implement a method (call it getByteOrdering()) that describes the byte arrays ordering.

So there is a relational as well as an oo solution to the managing the difference between these two classes. Theoretically, does anybody have thoughts on what the "best practices" might be in such a situation ? A relational database can be used to store anything, but do you think its a good idea to store code oriented information in a relational database ?
Obviously, this is an open ended question...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic