« Return to Thread: WebApplication Domain Object Storage

Re: WebApplication Domain Object Storage

by Nicolas Petton :: Rate this Message:

Reply to Author | View in Thread

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
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida

signature.asc (196 bytes) Download Attachment

 « Return to Thread: WebApplication Domain Object Storage