WebApplication Domain Object Storage

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

WebApplication Domain Object Storage

Rob Rothwell
Hello...

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
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: WebApplication Domain Object Storage

Nicolas Petton
Hi 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
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: WebApplication Domain Object Storage

Rob Rothwell
On Mon, Mar 24, 2008 at 12:19 PM, Nicolas Petton <[hidden email]> wrote:
Hi 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:

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
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida