BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-25-2009, 12:23 AM   #1
doni49
Thumbs Must Hurt
 
Join Date: Aug 2009
Model: Tour
PIN: N/A
Carrier: Verizon
Posts: 84
Default Planning ahead for Upgrades - Question

Please Login to Remove!

I've noticed that when I add new properties and/or methods to the classes in my app, the app crashes. It seems as though that's because the data that's on the device (still running in the simulator) doesn't fit well with the updated class).

Can someone offer some advice on dealing with the inevitable upgrades? I really dread the thought of having to "upgrade" the data from who knows what version to the current version.

If it was always upgrading from the most recently published version to the new one, that wouldn't be too bad. But there's no way to be sure that the user has the latest version installed.

TIA!
__________________
Don

Handspring Visor -> Handspring Visor Deluxe -> Palm Treo 650 on VZW -> Palm Treo 700p on VZW -> Blackberry Tour 9360 on VZW
Offline  
Old 10-25-2009, 08:29 AM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

You have to store something that indicates the version level of the data structures. Then you code will know if there is a version difference, and react accordingly.
Offline  
Old 10-25-2009, 09:17 AM   #3
doni49
Thumbs Must Hurt
 
Join Date: Aug 2009
Model: Tour
PIN: N/A
Carrier: Verizon
Posts: 84
Default

It's that "react accordingly" part that I'm having trouble with.

If the class is different from the data in the PersistentObject, I can't just say classObject = PersistentObject.getContents() -- because that's going to cause errors.
__________________
Don

Handspring Visor -> Handspring Visor Deluxe -> Palm Treo 650 on VZW -> Palm Treo 700p on VZW -> Blackberry Tour 9360 on VZW
Offline  
Old 10-25-2009, 11:41 AM   #4
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

Sure you can, if classObject is the old class.

Then you transfer the data to the new object, and persist the new object.
Offline  
Old 10-25-2009, 07:21 PM   #5
doni49
Thumbs Must Hurt
 
Join Date: Aug 2009
Model: Tour
PIN: N/A
Carrier: Verizon
Posts: 84
Default

Is that what the "getclass" method of the Object class is for? I was looking at that last week but found that puzzling.

I would also like to say that this site and you in particular have been so helpful to me while I learn this this stuff. It is very appreciated!
__________________
Don

Handspring Visor -> Handspring Visor Deluxe -> Palm Treo 650 on VZW -> Palm Treo 700p on VZW -> Blackberry Tour 9360 on VZW

Last edited by doni49; 10-25-2009 at 07:26 PM..
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


GE (Datex Ohmeda) Flow Sensor Transducer for Aestiva 5, Aespire, Avance, Aisys  picture

GE (Datex Ohmeda) Flow Sensor Transducer for Aestiva 5, Aespire, Avance, Aisys

$309.95



Lowrance PD - WBL Transducer 106 - 73 picture

Lowrance PD - WBL Transducer 106 - 73

$64.95



FREQUENCY TRANSDUCER picture

FREQUENCY TRANSDUCER

$44.99



4-20mA Output G1/4 Silicon Pressure Transmitter Transducer For Water Gas Oil picture

4-20mA Output G1/4 Silicon Pressure Transmitter Transducer For Water Gas Oil

$19.94



(Wi-Fi) Pressure Transducer Sender Stainless Steel 1/8NPT Oil Fuel Air Water picture

(Wi-Fi) Pressure Transducer Sender Stainless Steel 1/8NPT Oil Fuel Air Water

$39.00



50MM KTR Linear Displacement Sensor Position Transducer High Precision Ruler picture

50MM KTR Linear Displacement Sensor Position Transducer High Precision Ruler

$34.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.