Testing out BOSS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
J G
Reply | Threaded
Open this post in threaded view
|

Testing out BOSS

J G
As mentioned in a previous piece of message, I'm interested in using BOSS to
store and retrieve objects.

In time, I may have found some simple way to overcome the limits of BOSS. I
don't know if they are thought to be bad practice.

* Instead of changing class name try subclass it
By this, old objects created under old class name can still live in the boss
file when new ones added into it and there's nothing else to worry about.
Otherwise, if you change a name of a class it may cause trouble. And you have to
add some method (please do according to the manual) to let new class know how to
read previous objects.

* Sometimes a dictionary can be use as instance variable
I'm developing some classes rapidly and tend to add or remove some instance
variables, but this often cause trouble.

A simple way is to use a dictionary as instance variable and put what I have
just think of into it.
I test this and it works.

For example, when I'm developing a quotation class, I may at first want to leave
out amount and vol data but only remember open/high/low/close. Later I may
change my idea and believe it'll be better to remember all these. Now after
adding new variables to my Quotation class, the boss file will be ruined with
old objects.

But if I only add one instance variable named quotData into my class and let it
be a dictionary holding other objects, then I can add and remove things freely.

I love BOSS since it's the only thing that seems not to difficult to deal with
for me.

Thanks!

Best Regards,

Jim