Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

persisting dynamic objects in java

Thread view: 
highlander - 21 May 2007 23:05 GMT
Hello everyone !

     I need to develop a system which provides users with ability to
define attributes of objects and read, query and save  objects into a
database. The point is that it is the user who  defines attributes of
an object, not the programmer. I cannot use Hibernate to accomplish
this task because I don't know the names and the types of properties
of an object. For example, the user can define new class with two
properties, A as integer and B as double, and then instantiate objects
of that class, then user can remove property A and add property C as
boolean.
   Can anyone suggest a framework  that can be used for persisting
dynamic, not strongly-typed  objects ?
Robert Mark Bram - 21 May 2007 23:26 GMT
Sounds like a trippy system. :)

>       I need to develop a system which provides users with ability to
> define attributes of objects and read, query and save  objects into a
[quoted text clipped - 7 lines]
>     Can anyone suggest a framework  that can be used for persisting
> dynamic, not strongly-typed  objects ?

Not sure about what framework you need, but I can offer a suggestion
of how you might back it with a database.

Perhaps you need two tables:
- a generic table to hold data for any object, where each record
stores a "class id"
- a metadata table which identifies what class each "class id"
matches,

The generic table would have x varchar(y) columns. x is the max number
of attributes a user is likely to create in a class. y is the longest
string they are ever going to need. The first column would be a unique
ID for the whole table and the second table would be a class ID - a
foreign key pointing to the metadata table.

The metadata table describes the classes that can be modeled in the
generic table. It could store a list of the column names and types you
would expect for each class.

Your app would then need logic to manipulate the generic table for
updates, inserts and deletes for object x of class y. It would also
need logic to manipulate the dynamic class structures in the metadata
table and carry the consequences over to the generic table i.e. if
user deletes column b from class y, you need to remove all column b
values from the generic table.

I haven't tested any of this out of course, it is just an idea. I am
thinking you would also need to make sure to put indexing on those
tables to make sure large volumes don't slow you down..

Good luck..

Rob
:)
bojan.kraut@gmail.com - 31 May 2007 23:26 GMT
highlander je napisal:
> Hello everyone !
>
[quoted text clipped - 9 lines]
>     Can anyone suggest a framework  that can be used for persisting
> dynamic, not strongly-typed  objects ?

Hi,

we created such a framework. It works over Mysql database but currenty
we are researching to use OR with  hybernate sistem. Lucifer as the
system is called supports complete dynamic model, relationship
management, security, automatic runtime form generation etc. Also
JasperReports is integrated.

If you wish any screenshots we can send it to you. Currently out
documentation is in slovene language, but in couple of months
everithing will be in english. You can mail me at info@alcyone.si.
Richard Reynolds - 02 Jun 2007 00:26 GMT
>          Hello everyone !
>
[quoted text clipped - 9 lines]
>    Can anyone suggest a framework  that can be used for persisting
> dynamic, not strongly-typed  objects ?

how about looking at an object db rather than relational?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.