Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User jose.moreira's Avatar
    Join Date
    Aug 2006
    Posts
    1
    Hello, i'm building a j2me application where i have the data model using POJO's and Vectors.

    My objective is to persist and restore the object tree automaticly.

    At first, for every class i wanted to persist i had 2 methods, one to convert all of the object properties to byte[] data and another to reconstruct the object from byte[] data, ensuring the read/write order for input/output datastreams.

    But that was a lot of work and hard code to maintain, so i implemented the persistable object properties using an OrderedHashTable (an hashtable extended class that garantees the same order in adding/enumerating elements for appropriate din.readUTF()/din.readBlahBlah()).

    A few bugs apart i can now have a detatched data model, in wich the properties can be only objects (Strings, Booleans, Vectors, etc), all of wich are recursively persisted and restored.

    My doubt is that this all seems too complicated and the devices have limitations of course. For a simple app like a 'todo list' a recordstore of String objects works perfectly but whats the best approach when theres a complex datastructure to maintain.

    Example:

    i have a Blog object, that has a Vector of Entries; an Entry has another properties, etc

  2. #2
    Super Contributor peterblazejewicz's Avatar
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699
    hi,

    you can compare your solution with implementaiton in that project (which uses rms to persist newsgroups data on client):
    http://opensource.nokia.com/projects...ews/index.html
    I'm starting developing myself and so far I used set of rms to store data in linear way: one rms to store data about rss feeds ids, another for data for rss feeds, another one for data about rss feeds items ids, and last one with data from items, that way avoiding complexity in single rms implementation,

    regards,
    Peter

Similar Threads

  1. RMS data LOST problem in 3410!!!
    By bitsonic in forum Mobile Java General
    Replies: 6
    Last Post: 2009-03-27, 09:50
  2. Replies: 2
    Last Post: 2007-10-05, 20:40
  3. Persistent Object Framework for RMS
    By tiex in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-01-11, 11:16
  4. 7210 & 7250 RMS resetting problem
    By keithmcneill in forum Mobile Java General
    Replies: 1
    Last Post: 2003-11-13, 21:04
  5. rms object serial and deserializers
    By Godmachine in forum Mobile Java General
    Replies: 3
    Last Post: 2003-03-26, 12:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved