From renggli at iam.unibe.ch Tue Jul 11 20:23:21 2006 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 11 Jul 2006 20:23:21 +0200 Subject: isAbstract ? In-Reply-To: <44B39011.1050404@laposte.net> References: <44B39011.1050404@laposte.net> Message-ID: <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> Hi Damien, > reading VisualWorks code, I've seen an interesting pattern for the > isAbstract method that make subclasses concrete by default: > > isAbstract > "Override to true if a subclass is Abstract" > > ^self name = #TestResource this is SUnit, it is exactly the same in Squeak. > It can clean a bit things on all the Pier and Magritte hierarchies > in my opinion. What do you think about this ? (yes, I'm always > interested in your design opinions) There are two major problems with this approach: * It introduces a direct class reference, renaming the class TestResource breaks the implementation. * It only works for flat hierarchies where you have an abstract superclass and all the direct or indirect subclasses are concrete, unless you re-implement #isAbstract. In Pier and Magritte there are mostly many abstract classes inheriting from each other. The advantage of this approach is: * You only need to implement #isAbstract if you introduce a new abstract class, otherwise the answer is already correct. Maybe other people have other advantages/disadvantages? Or other ideas how to solve this particular problem. Not to mention that #isAbstract could be also calculated dynamically ... Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Tue Jul 11 20:53:53 2006 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 11 Jul 2006 20:53:53 +0200 Subject: isAbstract ? Message-ID: <7C7765A7-DFE6-4866-A046-E861C79BC379@iam.unibe.ch> > How would you calculate dynamically #isAbstract for a PRCommand for > example ? If I remember correctly, for the project I've done using > Magritte/Pier/MySQL, I implemented #doExecute for an abstract command. Something along the lines ... Behavior>>isAbstract ^ self allSelectors anySatisfy: [ :each | (self lookupSelector: each) hasLiteral: #subclassResponsibility ] ] Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Tue Jul 11 21:09:09 2006 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 11 Jul 2006 21:09:09 +0200 Subject: isAbstract ? In-Reply-To: <44B3F6BE.30106@laposte.net> References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> Message-ID: >>> How would you calculate dynamically #isAbstract for a PRCommand >>> for example ? If I remember correctly, for the project I've done >>> using Magritte/Pier/MySQL, I implemented #doExecute for an >>> abstract command. >> Something along the lines ... >> Behavior>>isAbstract >> ^ self allSelectors anySatisfy: [ :each | >> (self lookupSelector: each) >> hasLiteral: #subclassResponsibility ] ] > > > I think this works for real abstract classes. But it doesn't work > when the developer expect subclasses to send super and not override > particular methods. True. Object is an example, but can't think of any other core class that does this. Lukas -- Lukas Renggli http://www.lukas-renggli.ch From bert at impara.de Tue Jul 11 21:23:03 2006 From: bert at impara.de (Bert Freudenberg) Date: Tue, 11 Jul 2006 21:23:03 +0200 Subject: isAbstract ? In-Reply-To: References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> Message-ID: <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> Am 11.07.2006 um 21:09 schrieb Lukas Renggli: >>>> How would you calculate dynamically #isAbstract for a PRCommand >>>> for example ? If I remember correctly, for the project I've done >>>> using Magritte/Pier/MySQL, I implemented #doExecute for an >>>> abstract command. >>> Something along the lines ... >>> Behavior>>isAbstract >>> ^ self allSelectors anySatisfy: [ :each | >>> (self lookupSelector: each) >>> hasLiteral: #subclassResponsibility ] ] >> >> >> I think this works for real abstract classes. But it doesn't work >> when the developer expect subclasses to send super and not override >> particular methods. > > True. Object is an example, but can't think of any other core class > that does this. I wouldn't count Object as an example because it's not an abstract class. - Bert - From renggli at iam.unibe.ch Wed Jul 12 07:46:43 2006 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Wed, 12 Jul 2006 07:46:43 +0200 Subject: isAbstract ? In-Reply-To: <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> Message-ID: <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> > I wouldn't count Object as an example because it's not an abstract > class. Why do you think Object is not an abstract class? -- Lukas Renggli http://www.lukas-renggli.ch From a3aan at xs4all.nl Wed Jul 12 10:56:12 2006 From: a3aan at xs4all.nl (Adriaan van Os) Date: Wed, 12 Jul 2006 10:56:12 +0200 (CEST) Subject: isAbstract ? In-Reply-To: <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> Message-ID: <9508.193.173.83.5.1152694572.squirrel@webmail.xs4all.nl> Look for methods sending 'Object new' in your image. I found a few dozens in my VASt image. Instances of Object are often used as (temporary) unique objects. Cheers, Adriaan. >> I wouldn't count Object as an example because it's not an abstract >> class. > > Why do you think Object is not an abstract class? > > -- > Lukas Renggli > http://www.lukas-renggli.ch > > > > _______________________________________________ > SmallWiki, Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki > -- http://vdg38bis.xs4all.nl From philippe.marschall at gmail.com Wed Jul 12 11:30:37 2006 From: philippe.marschall at gmail.com (Philippe Marschall) Date: Wed, 12 Jul 2006 11:30:37 +0200 Subject: isAbstract ? In-Reply-To: <9508.193.173.83.5.1152694572.squirrel@webmail.xs4all.nl> References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> <9508.193.173.83.5.1152694572.squirrel@webmail.xs4all.nl> Message-ID: <66666f210607120230n59bb64a4u87876344bdcb2160@mail.gmail.com> 2006/7/12, Adriaan van Os : > Look for methods sending 'Object new' in your image. I found a few dozens > in my VASt image. Look at all the self sends in Object that are not implemented in Object. ;) (This may not be the case in VASt) Philippe From renggli at iam.unibe.ch Wed Jul 12 12:34:24 2006 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Wed, 12 Jul 2006 12:34:24 +0200 Subject: isAbstract ? In-Reply-To: <66666f210607120230n59bb64a4u87876344bdcb2160@mail.gmail.com> References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> <9508.193.173.83.5.1152694572.squirrel@webmail.xs4all.nl> <66666f210607120230n59bb64a4u87876344bdcb2160@mail.gmail.com> Message-ID: > Look for methods sending 'Object new' in your image. I found a few > dozens in my VASt image. Yes, I know, but this is not something Object is designed for. Lukas -- Lukas Renggli http://www.lukas-renggli.ch From cputney at wiresong.ca Wed Jul 12 17:08:55 2006 From: cputney at wiresong.ca (Colin Putney) Date: Wed, 12 Jul 2006 11:08:55 -0400 Subject: isAbstract ? In-Reply-To: References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> <9508.193.173.83.5.1152694572.squirrel@webmail.xs4all.nl> <66666f210607120230n59bb64a4u87876344bdcb2160@mail.gmail.com> Message-ID: <3BE13F9A-CE18-4D9B-BCC1-153B086CBD05@wiresong.ca> On Jul 12, 2006, at 6:34 AM, Lukas Renggli wrote: >> Look for methods sending 'Object new' in your image. I found a few >> dozens in my VASt image. > > Yes, I know, but this is not something Object is designed for. Well, this is Smalltalk. There is no hard and fast definition of "Abstract class." What if you create an instance of a class that has methods that send #subclassResponsibility, but never call those methods? If you have a class with a complete implementation of some concept, but only happen to create instances of its subclasses, is it abstract or concrete? How about a class that sends #subclassResponsibility but answers #isAbstract with true? How many angels can dance on the head of a pin? For purposes of SUnit, the meaning of "abstract" is simple. A TestCase subclass that answers #isAbstract with true will not be included in automatically built TestSuites. It's that simple. With that purpose in mind, the existing implementation is fine: It works nicely for the common case - a single abstract class with several concrete subclasses It's simple, so that in the uncommon case of several levels of abstract classes, the redundant implementations are easy to write and easy to understand If an abstract class is renamed, #isAbstract shows up as a reference, and can be updated easily Colin From keith_hodges at yahoo.co.uk Thu Jul 13 19:31:55 2006 From: keith_hodges at yahoo.co.uk (Keith Hodges) Date: Thu, 13 Jul 2006 18:31:55 +0100 Subject: [Smallwiki] Re: isAbstract ? In-Reply-To: <3BE13F9A-CE18-4D9B-BCC1-153B086CBD05@wiresong.ca> References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> <9508.193.173.83.5.1152694572.squirrel@webmail.xs4all.nl> <66666f210607120230n59bb64a4u87876344bdcb2160@mail.gmail.com> <3BE13F9A-CE18-4D9B-BCC1-153B086CBD05@wiresong.ca> Message-ID: <44B6838B.1050308@yahoo.co.uk> I get an error when loading the latest Pier-Seaside package lr.74 UndefinedObject does not Understand #isSeparator. Keith p.s. I am using 3.8-6665 ___________________________________________________________ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html From renggli at iam.unibe.ch Thu Jul 13 19:51:51 2006 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Thu, 13 Jul 2006 19:51:51 +0200 Subject: UndefinedObject does not Understand #isSeparator. In-Reply-To: <44B6838B.1050308@yahoo.co.uk> References: <44B39011.1050404@laposte.net> <96DF5D43-90AC-494A-8832-74BA5E6C8BBA@iam.unibe.ch> <44B3EFD8.9040409@laposte.net> <44B3F6BE.30106@laposte.net> <49593783-B4BE-45D1-97FB-B02EA46E52B3@impara.de> <4827B3B0-6133-4F44-9C6F-E6BD869189CE@iam.unibe.ch> <9508.193.173.83.5.1152694572.squirrel@webmail.xs4all.nl> <66666f210607120230n59bb64a4u87876344bdcb2160@mail.gmail.com> <3BE13F9A-CE18-4D9B-BCC1-153B086CBD05@wiresong.ca> <44B6838B.1050308@yahoo.co.uk> Message-ID: <13925ABE-7039-487A-9A44-73BB0F53791E@iam.unibe.ch> > I get an error when loading the latest Pier-Seaside package lr.74 > UndefinedObject does not Understand #isSeparator. What is the stack-trace? Lukas -- Lukas Renggli http://www.lukas-renggli.ch From billksun at yahoo.com Sat Jul 22 00:52:01 2006 From: billksun at yahoo.com (Bill Sun) Date: Fri, 21 Jul 2006 15:52:01 -0700 (PDT) Subject: Trouble Following Pier Example in Master Thesis Message-ID: <20060721225201.77586.qmail@web53302.mail.yahoo.com> Hi all, I've been having trouble with the Pier Adaptive Forms example in the thesis titled "Magritte ? Meta-Described Web Application Development". In particular, I've typed all the necessary code in my browser, prefixing "PR" and "MA" where I think should be appropriate. I can add the Form, but the "Edit Form" command that I created will not work. I get the following output when clicking on the "Edit Form" link: (In HTML format) PREditFormCommand(Object)>>doesNotUnderstand: #labelselfa PREditFormCommandtempsaMessagelabelinst varspropertiesnilcontexta PRContext stucture: 'Test Form' command: 'Edit Form'answernilmetamodela MAContainer label: '' comment: nilMASelectorAccessor>>read:self(MASelectorAccessor read: #label write: #label:)tempsaModela PREditFormCommandinst varspropertiesnilreadSelector#labelwriteSelector#label:PREditFormCommand(Object)>>readUsing:selfa PREditFormCommandtempsaDescriptiona MAStringDescription label: 'Label' comment: nilinst varspropertiesnilcontexta PRContext stucture: 'Test Form' command: 'Edit Form'answernilmetamodela MAContainer label: '' comment: nil[] in MACheckedMemento(MAMemento)>>pullRaw {[:each | result at: each put: (self model readUsing: each)]}selfa MACheckedMemento model: a PREditFormCommandtempsresulta Dictionary(a MAStringDescription label: 'Kind' comment: nil->'Edit Form' )eacha MAStringDescription label: 'Label' comment: nilinst varspropertiesnilmodela PREditFormCommanddescriptiona MAPriorityContainer label: 'Container' comment: nilcacheniloriginalnil(snipped) Also, there seems to be a missing closing parenthesis on page 41 in the Form>>description method definition. The Pier setup is obtained by installing the Pier Unix Security 1.0.3-alpha from SqueakMap Package Loader. In this version of Pier, clicking on the "Environment" command link will also crash Pier, is this expected? Note: I am new to Smalltalk and Squeak. Thanks, -Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20060722/7b59ddf1/attachment.html From damien.cassou at laposte.net Sat Jul 22 08:46:13 2006 From: damien.cassou at laposte.net (Damien Cassou) Date: Sat, 22 Jul 2006 08:46:13 +0200 Subject: Trouble Following Pier Example in Master Thesis In-Reply-To: <20060721225201.77586.qmail@web53302.mail.yahoo.com> References: <20060721225201.77586.qmail@web53302.mail.yahoo.com> Message-ID: <44C1C9B5.9060801@laposte.net> Bill Sun wrote: > Hi all, Hello Bill, > I've been having trouble with the Pier Adaptive Forms example in the > thesis titled "Magritte ? Meta-Described Web Application Development". > > In particular, I've typed all the necessary code in my browser, > prefixing "PR" and "MA" where I think should be appropriate. I can add > the Form, but the "Edit Form" command that I created will not work. I > get the following output when clicking on the "Edit Form" link: > > (snipped) > Can you send us a file out of your code please ? > Also, there seems to be a missing closing parenthesis on page 41 in the > Form>>description method definition. I agree: Form>>description ^ (Container withAll: super description) , (self metamodel do: [ :each | each beEditable ]) > The Pier setup is obtained by installing the Pier Unix Security > 1.0.3-alpha from SqueakMap Package Loader. In this version of Pier, > clicking on the "Environment" command link will also crash Pier, is this > expected? You may want to try using the last version of Magritte and Pier from Monticello. Do you know how to do this ? > Note: I am new to Smalltalk and Squeak. Welcome ! Bye -- Damien From billksun at yahoo.com Mon Jul 24 19:07:26 2006 From: billksun at yahoo.com (Bill Sun) Date: Mon, 24 Jul 2006 10:07:26 -0700 (PDT) Subject: Trouble Following Pier Example in Master Thesis In-Reply-To: <44C1C9B5.9060801@laposte.net> Message-ID: <20060724170726.22022.qmail@web53310.mail.yahoo.com> Hi Damien, Thanks for your response! Here's the file-out. I'll try out the latest version of Magritte and Pier from Monticello later today. -Bill ----- Original Message ---- From: Damien Cassou To: Bill Sun ; "SmallWiki, Magritte, Pier and Related Tools ..." Sent: Friday, July 21, 2006 11:46:13 PM Subject: Re: Trouble Following Pier Example in Master Thesis Bill Sun wrote: > Hi all, Hello Bill, > I've been having trouble with the Pier Adaptive Forms example in the > thesis titled "Magritte ? Meta-Described Web Application Development". > > In particular, I've typed all the necessary code in my browser, > prefixing "PR" and "MA" where I think should be appropriate. I can add > the Form, but the "Edit Form" command that I created will not work. I > get the following output when clicking on the "Edit Form" link: > > (snipped) > Can you send us a file out of your code please ? > Also, there seems to be a missing closing parenthesis on page 41 in the > Form>>description method definition. I agree: Form>>description ^ (Container withAll: super description) , (self metamodel do: [ :each | each beEditable ]) > The Pier setup is obtained by installing the Pier Unix Security > 1.0.3-alpha from SqueakMap Package Loader. In this version of Pier, > clicking on the "Environment" command link will also crash Pier, is this > expected? You may want to try using the last version of Magritte and Pier from Monticello. Do you know how to do this ? > Note: I am new to Smalltalk and Squeak. Welcome ! Bye -- Damien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20060724/d9fe7934/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Pier-Forms.st Type: application/octet-stream Size: 3346 bytes Desc: not available Url : http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20060724/d9fe7934/Pier-Forms-0001.obj From billksun at yahoo.com Tue Jul 25 19:52:19 2006 From: billksun at yahoo.com (Bill Sun) Date: Tue, 25 Jul 2006 10:52:19 -0700 (PDT) Subject: Trouble Following Pier Example in Master Thesis In-Reply-To: <44C5C819.9020508@laposte.net> Message-ID: <20060725175219.83343.qmail@web53312.mail.yahoo.com> Damien, Ah, I see, the example from the thesis was integrated into the latest Pier. That's probably why you already have it. The main difference that I see from the newest Pier and the code that I entered manually is that the PREditFormCommand class has both readUsing: and write:using: methods in the latest Pier while the code that I entered from the master thesis did not. -Bill ----- Original Message ---- From: Damien Cassou To: Bill Sun Sent: Tuesday, July 25, 2006 12:28:25 AM Subject: Re: Trouble Following Pier Example in Master Thesis Bill Sun wrote: > Hi Damien, Hi Bill, > Thanks for your response! Here's the file-out. > > I'll try out the latest version of Magritte and Pier from > Monticello later today. Your class is already present in my image so you may find your answer into the last Magritte and Pier versions on monticello (repository: http://mc.lukas-renggli.ch/magritte or /pier) If this is still not clear, ask here. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20060725/97ef1d3c/attachment.html From billksun at yahoo.com Tue Jul 25 22:32:49 2006 From: billksun at yahoo.com (Bill Sun) Date: Tue, 25 Jul 2006 13:32:49 -0700 (PDT) Subject: Trouble Following Pier Example in Master Thesis Message-ID: <20060725203249.24812.qmail@web53306.mail.yahoo.com> !-- DIV {margin:0px;}-->Yes the PRForms work perfectly in the newest Pier. The main cause was indeed the missing readUsing: and write:using: methods. Here's my attempt at understanding what went wrong: In my case, the missing readUsing: method caused the readUsing: method in Object to respond instead, which read the description of a PREditFormCommand instance rather than the description from the metamodel of the PRForm instance, which was missing a bunch of descriptions. I'm not quite sure how does Pier knows what descriptions it needs to look for when I fed it the wrong descriptions. Can anyone shed some light? Thanks, -Bill ----- Original Message ---- From: Damien Cassou To: Bill Sun Sent: Tuesday, July 25, 2006 11:02:46 AM Subject: Re: Trouble Following Pier Example in Master Thesis Bill Sun wrote: > Damien, > > Ah, I see, the example from the thesis was integrated into the latest > Pier. That's probably why you already have it. > > The main difference that I see from the newest Pier and the code that I > entered manually is that the PREditFormCommand class has both readUsing: > and write:using: methods in the latest Pier while the code that I > entered from the master thesis did not. Does it work on the new version ? Do you understand why it doesn't on the old one ? More questions ? Bye -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20060725/9ad3fe13/attachment.html From damien.cassou at laposte.net Sun Jul 30 12:35:25 2006 From: damien.cassou at laposte.net (Damien Cassou) Date: Sun, 30 Jul 2006 12:35:25 +0200 Subject: [Pier] State of persistency ? Message-ID: <44CC8B6D.5060406@laposte.net> Hi, what is the state of the persistency layer in Pier ? What is implemented and what is not ? Thank you Damien From damien.cassou at laposte.net Sun Jul 30 13:51:25 2006 From: damien.cassou at laposte.net (Damien Cassou) Date: Sun, 30 Jul 2006 13:51:25 +0200 Subject: [Pier] Simplest persistency layer Message-ID: <44CC9D3D.2020201@laposte.net> Hi, since the current persistency models do not work (at least for me), I have created my own which saves the image on each modification: PRPersistency suclass: #PRSaveImagePersistency ... PRSaveImagePersistency>>snapshot [SmalltalkImage current snapshot: true andQuit: false] forkAt: Processor userBackgroundPriority PRSaveImagePersistency>>log: aContext self snapshot PRSaveImagePersistency>>do: aBlock Nothing more From ramonleon at cox.net Sun Jul 30 17:57:49 2006 From: ramonleon at cox.net (Ramon Leon) Date: Sun, 30 Jul 2006 08:57:49 -0700 Subject: [Pier] Simplest persistency layer In-Reply-To: <44CC9D3D.2020201@laposte.net> References: <44CC9D3D.2020201@laposte.net> Message-ID: <44CCD6FD.2060905@cox.net> > Hi, > > since the current persistency models do not work (at least for me), I > have created my own which saves the image on each modification: > > PRPersistency suclass: #PRSaveImagePersistency > ... > > PRSaveImagePersistency>>snapshot > [SmalltalkImage current snapshot: true andQuit: false] > forkAt: Processor userBackgroundPriority > > PRSaveImagePersistency>>log: aContext > self snapshot > > PRSaveImagePersistency>>do: aBlock try this for do: and reverseDo: do: aBlock contexts do: [:each | aBlock value: (each setKernel: self kernel; yourself)] reverseDo: aBlock contexts reverseDo: [:each | aBlock value: (each setKernel: self kernel; yourself)] and you'll at least get history working. The code in the PRImagePersistency is wrong and doesn't work, this code will. I checked in these changes once but Lucas never merged them so they were lost leaving the PRImagePersistency non functional. I tried digging into this once myself and fixing PRFilePersistency, but ran into problems I couldn't get around, here's the relevant info if you want to take a crack at it. PRFilePersistency>>do: aBlock "There's a bug in deserialization that leaves commands with no fields or context, this causes an error which despite the ensure below, leaves the filestream open preventing any further use of that file, at which point fileNamed returns nil for all future calls. I'm returning self to prevent an error, the gc does eventually close the file and things start working again. I think the bug is actually in the MABinaryWriter when it serializes the command" | fileStream | fileStream := self directory fileNamed: self logFilename. fileStream ifNil: [^self]. [[fileStream atEnd] whileFalse: [aBlock value: ((MABinaryReader read: fileStream) setKernel: self kernel; yourself)]] ensure: [fileStream close] and... PREditCommand>>write: anObject using: aDescription "this guard clause prevents this command from blowing up the deserialization of commands in PRFilePersistency, which is currently buggy for some reason, will remove once I chase down the error. - rjl" context ifNil:[^self]. ^ (self description includes: aDescription) ifFalse: [ super write: anObject using: aDescription ] ifTrue: [ self fields at: aDescription put: anObject ] Currently the lack of persistence is a serious show stopper with Pier, hopefully Lucas, or someone with the necessary know how can find some time in the near future to fix this. From keith_hodges at yahoo.co.uk Mon Jul 31 03:16:19 2006 From: keith_hodges at yahoo.co.uk (Keith Hodges) Date: Mon, 31 Jul 2006 02:16:19 +0100 Subject: [Smallwiki] [Pier] State of persistency ? In-Reply-To: <44CC8B6D.5060406@laposte.net> References: <44CC8B6D.5060406@laposte.net> Message-ID: <44CD59E3.4010003@yahoo.co.uk> Dear Damien, I am also working on the persistency issue, I need something working well as soon as possible. Content authors for my site are nagging me already, we go live in October. I figured that magma was at least worth a try. As as DB it is all in the smalltalk image without any dependency upon external servers. Magma appears to be aiming to make persistency as simple as possible. Raw performance is unlikely to be an issue for me. It seems like the right fit. I would have had something working by now if it were not for my windows installation taking a dive due to disk errors. I am now up and running again (just about). In the next couple of days/weeks I should have something to show for my troubles. If you want to try magma with seaside there are some updates/bug fixes around (email me or, check recent history of the magma list because the repository has yet to be updated) best regards Keith ___________________________________________________________ All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine http://uk.docs.yahoo.com/nowyoucan.html From damien.cassou at laposte.net Mon Jul 31 20:09:33 2006 From: damien.cassou at laposte.net (Damien Cassou) Date: Mon, 31 Jul 2006 20:09:33 +0200 Subject: [Pier] Simplest persistency layer In-Reply-To: <44CCD6FD.2060905@cox.net> References: <44CC9D3D.2020201@laposte.net> <44CCD6FD.2060905@cox.net> Message-ID: <44CE475D.2040106@laposte.net> Hi Ramon, Ramon Leon wrote: >> since the current persistency models do not work (at least for me), I >> have created my own which saves the image on each modification: >> >> PRPersistency suclass: #PRSaveImagePersistency >> ... >> >> PRSaveImagePersistency>>snapshot >> [SmalltalkImage current snapshot: true andQuit: false] >> forkAt: Processor userBackgroundPriority >> >> PRSaveImagePersistency>>log: aContext >> self snapshot >> >> PRSaveImagePersistency>>do: aBlock > > try this for do: and reverseDo: > > do: aBlock > contexts do: [:each | > aBlock value: (each setKernel: self kernel; yourself)] > > reverseDo: aBlock > contexts reverseDo: [:each | > aBlock value: (each setKernel: self kernel; yourself)] you probably misunderstood what I did. In fact, I propose a completely new persistency model that has nothing to do with PRImagePersistency (mine is called PRSaveImagePersistency). This persistency layer saves the image every time the model is modified. It doesn't manage concurrence nor recovering after a bad snapshot. From damien.cassou at laposte.net Mon Jul 31 20:12:52 2006 From: damien.cassou at laposte.net (Damien Cassou) Date: Mon, 31 Jul 2006 20:12:52 +0200 Subject: [Smallwiki] [Pier] State of persistency ? In-Reply-To: <44CD59E3.4010003@yahoo.co.uk> References: <44CC8B6D.5060406@laposte.net> <44CD59E3.4010003@yahoo.co.uk> Message-ID: <44CE4824.9070304@laposte.net> Hi Keith, Keith Hodges wrote: > I am also working on the persistency issue, I need something working > well as soon as possible. Content authors for my site are nagging me > already, we go live in October. > > I figured that magma was at least worth a try. As as DB it is all in the > smalltalk image without any dependency upon external servers. Magma > appears to be aiming to make persistency as simple as possible. Raw > performance is unlikely to be an issue for me. It seems like the right fit. > [...] In fact, my Pier setup is meant to be used for a static website with very rare modification and by only one person. I don't think I need magma at all, but thank you for the proposal. Bye From ramon.leon at allresnet.com Mon Jul 31 20:35:58 2006 From: ramon.leon at allresnet.com (Ramon Leon) Date: Mon, 31 Jul 2006 11:35:58 -0700 Subject: [Pier] Simplest persistency layer In-Reply-To: <44CE475D.2040106@laposte.net> Message-ID: <02b701c6b4d0$2a7e10e0$4b00a8c0@hq.allresnet.com> > > you probably misunderstood what I did. In fact, I propose a > completely new persistency model that has nothing to do with > PRImagePersistency (mine is called PRSaveImagePersistency). > > This persistency layer saves the image every time the model > is modified. > It doesn't manage concurrence nor recovering after a bad snapshot. No, I understood what you were doing, you misunderstand what my suggestion offers. With your save image persister, if you use the do and reverseDo I suggest, the change and history views for a page will work, which they currently don't. From damien.cassou at laposte.net Mon Jul 31 20:46:17 2006 From: damien.cassou at laposte.net (Damien Cassou) Date: Mon, 31 Jul 2006 20:46:17 +0200 Subject: [Pier] Simplest persistency layer In-Reply-To: <02b701c6b4d0$2a7e10e0$4b00a8c0@hq.allresnet.com> References: <02b701c6b4d0$2a7e10e0$4b00a8c0@hq.allresnet.com> Message-ID: <44CE4FF9.6050905@laposte.net> Ramon Leon wrote: >> you probably misunderstood what I did. In fact, I propose a >> completely new persistency model that has nothing to do with >> PRImagePersistency (mine is called PRSaveImagePersistency). >> >> This persistency layer saves the image every time the model >> is modified. >> It doesn't manage concurrence nor recovering after a bad snapshot. > > > No, I understood what you were doing, you misunderstand what my suggestion > offers. With your save image persister, if you use the do and reverseDo I > suggest, the change and history views for a page will work, which they > currently don't. Oooops, I'm really sorry. What makes me understand that you did not understand was the reference to the variable 'contexts' which only exists in PRImagePersistency. So your code won't work on my persistency layer. What do I need to change to get the history ? Thanks From ramon.leon at allresnet.com Mon Jul 31 21:27:42 2006 From: ramon.leon at allresnet.com (Ramon Leon) Date: Mon, 31 Jul 2006 12:27:42 -0700 Subject: [Pier] Simplest persistency layer In-Reply-To: <44CE4FF9.6050905@laposte.net> Message-ID: <02d001c6b4d7$64a91a10$4b00a8c0@hq.allresnet.com> > > > Oooops, I'm really sorry. What makes me understand that you > did not understand was the reference to the variable > 'contexts' which only exists in PRImagePersistency. So your > code won't work on my persistency layer. What do I need to > change to get the history ? > > > Thanks You should really just subclass PRImagePersistency, use the do and reverseDo I sent, and override snapshot and log with your versions.