FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mango.io serializable

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
BenHinkle



Joined: 27 Mar 2004
Posts: 76

PostPosted: Thu Jun 24, 2004 6:52 am    Post subject: mango.io serializable Reply with quote

Why does SerializableRegistry.enroll take an object reference? That means that when I start my program up I need to instaniate one of everything that might ever be deserialized. With classes that are tightly interdependent I might have to create a whole tree of objects just to register the root.
A registry of functions avoids that problem. Then instead of calling
object = registry[guid];
object = object.create(reader)
it becomes
createfcn = registry[guid];
object = createfcn(reader);
I would also like to pass guid to the createfcn but that isn't a big deal.
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Thu Jun 24, 2004 2:35 pm    Post subject: Reply with quote

I agree Ben.

See over here for the same gripe from me ("Mango Sucks ...") http://www.dsource.org/forums/viewtopic.php?t=157

I think it will change to a Proxy for the class instead, which might actually be the real concrete class for small instances. I was thinking about perhaps an ISerializableFactory interface or something along those lines.

The reason its currently a class and not a function (or delegate) is that there's actually several related tasks involved (read/write/create/identify). It just seemed to make more sense to me for them to be class members. Also, there's not usually that many kinds of classes that get deserialized within a given app (a few handfulls?), so I'm not sure that the overhead is such a bad thing. I could be completely wrong on both counts though. What do you think? I'm totally open to alternatives ...
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Jun 27, 2004 2:09 am    Post subject: Reply with quote

Just a note that the ISerializable stuff will be renamed in Beta-8, and has matured appropriately from its initial simplistic incarnation.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group