[PW-dev] Re: [Perl-widget-developer] Freezing and Thawing widgets
Status: Alpha
Brought to you by:
spadkins
From: Jay L. <Ja...@La...> - 2001-06-11 14:34:20
|
From: "Gunther Birznieks" <gu...@ex...> > How do you propose supporting this API-wise? $stored_data = $widget->freeze; This should return a data structure (i.e. hash) in a format like Storable or Data::Dumper of all of the properties of the object that are persistant. I don't belive that you can just freeze or thaw your runtime object as it might have extra information that is not suitable for storing. (ie/ object ref to controller object, etc). Not to mention it is implementation specific - and if you change your implementation your frozen objects won't be as easy to recall. My idea to get this data back might be as follows: $widget=Widget->new( thaw => $stored_data ); # Will know what class this object is from contents of $stored_data or $widget=new Widget::Foo; $widget->thaw( $stored_data ); # Gotta check that stored_data widget class matches this widget class, eh? Just what I had in mind... > Of course, this post was one of the better ones as some didn't bother > changing subjects at all. :) Thanks for noticing. J > > At 11:06 AM 6/6/2001 -0400, Jay Lawrence wrote: > >The purpose? Ah, good question. More variety of configuration options. I > >expect that I'll want to configure my widgets separate from my code. (At > >least the types of widgets I'm thinking about) > > > >So this gives me the option to configure them elsewhere, save them (freeze), > >and have my code thaw all the widgets that it cares about. FURTHERMORE, if I > >want to give others the chance to configure some or all widgets - I can > >allow them to modify the saved definition and resave it as I deem > >appropriate. > > > >The widget has to know how to freeze and thaw itsself because of course that > >is implementation dependant to some degree. IE/ Data::Dumper would dump out > >the hash that holds all of the widget properties - which in itsself is an > >implementation detail. > > > >Jay > > > > > At 10:05 AM 6/6/2001 -0400, Jay Lawrence wrote: > > > >One other thing I really wanna see is thaw/freeze support. Scary? Not > > > >really. Obviously if you don't wanna thaw and freeze widgets ever this > >will > > > >be no skin off your nose - it is optional to use. > > > > > > > >I belive that one thing needs to happen in the thaw phase - that is a > >"use" > > > >for the widget's class. There is no guarantee that you've "use"d that > >widget > > > >class already. > > > > > > > > > > Interesting idea. > > > What is the purpose of freezing and thawing widgets? > > > > > > Stephen > > > > > > > > > > > > > > >_______________________________________________ > >Perl-widget-developer mailing list > >Per...@li... > >http://lists.sourceforge.net/lists/listinfo/perl-widget-developer > > __________________________________________________ > Gunther Birznieks (gun...@eX...) > eXtropia - The Open Web Technology Company > http://www.eXtropia.com/ > > > _______________________________________________ > Perl-widget-developer mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-widget-developer > |