|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
WebApplication Domain Object StorageHello...
I think this is a very, VERY basic question, but where do most of you actually store your domain objects that your WebApplication views? Is it usually a singleton object, stored in the class? Is there ever a reason you would want more than one? Multiple users get NEW WebApplications, but they are all using the same copy of the underlying object, right?
Just asking because I am worried I am missing something fundamental! Rob
_______________________________________________ Aida mailing list Aida@... http://lists.aidaweb.si/mailman/listinfo/aida |
|
|
Re: WebApplication Domain Object StorageHi Rob,
We usually store them somewhere accessible from the site. In Scribo for example, an instance of a blog is stored in the repository, itself stored in the site: AIDASite>>repository ^self userServices at: #Repository ifAbsent: [self addUserService: (Repository newOnSite: self) named: #Repository. ^self repository]. Repository>>blog | blog | ^self otherAt: #blog ifAbsent: [ blog := Blog newOn: self site. self site urlResolver defaultURL: '/blog.html' forObject: blog. self otherAt: #blog put: blog. ^blog] Anyway, adding an object to the urlResolver is enough: mySite urlResolver addObject: myObject withURL: '/myObject.html' Nico -- Nicolas Petton http://nico.bioskop.fr ___ ooooooo OOOOOOOOO |Smalltalk| OOOOOOOOO ooooooo \ / [|] -------------------------------- Ma clé PGP est disponible ici : http://nico.bioskop.fr/pgp-key.html _______________________________________________ Aida mailing list Aida@... http://lists.aidaweb.si/mailman/listinfo/aida |
|
|
Re: WebApplication Domain Object StorageOn Mon, Mar 24, 2008 at 12:19 PM, Nicolas Petton <petton.nicolas@...> wrote: Hi Rob, Ok...so in your case, each blog is it's own instance of your domain "blog" object...which makes a lot of sense and takes full advantage of the nice url's, etc. And it looks like I could store those instances by retrieving the WebApplication site with self session site And then use the AIDASite userServices Dictionary as a convenient place to store my values. (This would probably tie in nicely with Magma, which gives you a root dictionary object as well).
Thank you...I will definitely be putting this type of information in the Aida Programmers Guide--though I;m not sure which section it would best fit under so someone new to Aida could find it... Rob _______________________________________________ Aida mailing list Aida@... http://lists.aidaweb.si/mailman/listinfo/aida |
| Free Forum Powered by Nabble | Forum Help |