• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Serialization and future compatibility

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm been thinking to start to design a new kind of system based on special server network and serialized objects. The aim is that you can send an object to the network where it can move by itself and come back (if said so) when the given task have been completed.
I would like to get some tips and advises how to take into account Java version changes in future? - Or do I have to worry about this at all? Any comments are very appreciated.
Br,
Jorma Ikonen
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may be trying to reinvent the wheel... your idea sounds like Jini or advanced RMI agents.. you may want to look into those projects before embarking on your development.
Also, serialization is a fickle beast... you have to be very careful to isolate your classes from change so that a new version of the SDK or your API do not invalidate all previous versions serialized files... a real nightmare. You may want to look at some sort of XML externaization instead.
Hope this helps.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, serialization and dealing with changes to you object graph can be tricky. Check out the new XML serialization support added in Java 1.4 under java.beans. There are lots of articles out there on the topic as well (Google). I've been interested in the topic for a while, and so far I haven't found any system that gets it right by understanding that it's your entire object graph the needs to undergo upgrades, not just individual classes, and you need to be able to control these conversions in code - no automatic nulling of variables and such will suffice when you make radical changes to the object graph. I recently got a nice system working with business objects stored in a relational database that allowed me to upgrade my schema/object graph without restriction and correctly migrate the legacy data, but this was written at the application level, without language level support.
 
Jorma Ikonen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks of your hints.
I got a headache after reading documentation of Jini... Maybe a complex issue requires complex solution, but I'm not sure that Jini's way of working is a natural way to do things.
The XML serialization felt much more better, but it do not fill a requirement of 100% compatibility either.
Right now I'm going to call "a time out" for myself and sit down for a while and but some more focus to find & descripe the problematic of compatibility.
By the way, have your never tested to compile new class at runtime? Requirements of the runtime class could be handled via Abstract- and Interface classes.
Just figuring that the data (object and methods) could be in XML-format something like this:
<networkObject home="123.123.123.123" port="4444">
<class name="Command" compilerArguments="...>
class Command {
...
...
...}
</class>
<class ...>
...
</class>
<host name="localhost" port="4445" class="Command" arg=...>
<result>
</result>
</host>
<host name="111.222.333.444" class=...>
<result>
</result>
</host>
...
</networkObject>
Oh fuck, this starts to sound as awful as other ways...
Br,
Jorma
 
reply
    Bookmark Topic Watch Topic
  • New Topic