Transient objects URI

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

Transient objects URI

Esteban A. Maringolo
Hi,

How do you manage the url of transient objects?

It is... not all the objects have a persistent RESTful URI.

For example, if you have a checkout procedure or a wizard, that instance is going to exist only once, and its URI should be the same always, e.g. '/foo/creationwizard'.
The concept of an URI for each object is ok, and homogeneous, but for some objects I simply don't want it. I don't want to preserve a record object-> uri.

Am I using it wrong?

Regards,

Esteban

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Transient objects URI

Janko Mivšek
Hi Esteban,

Esteban A. Maringolo wrote:

> How do you manage the url of transient objects?
>
> It is... not all the objects have a persistent RESTful URI.

For transient objects you need manually remove them from URL resolver
after you don't need them anymore:

    (AIDASite named: 'aidademo) urlResolver removeObject: yourObject

It would be nice if the URL resolver would be kind of WeakDictionary to
remove such an object automatically, but many Smalltalks are weak here,
so I gave up that idea quite early.

But, if there is an idea how to solve that better, we can improve URL
resolving for transient objects better ...

Also, you can extend the URLResolver to suit your needs, for instance to
calculate from URL a key for reaching the object, which is handy for
objects in relational databases.


> For example, if you have a checkout procedure or a wizard, that instance
> is going to exist only once, and its URI should be the same always, e.g.
> '/foo/creationwizard'.
> The concept of an URI for each object is ok, and homogeneous, but for
> some objects I simply don't want it. I don't want to preserve a record
> object-> uri.
>
> Am I using it wrong?


Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Transient objects URI

Esteban A. Maringolo
Hi Janko,

On Wed, Dec 17, 2008 at 12:04, Janko Mivšek <[hidden email]> wrote:
> > How do you manage the url of transient objects?
> >
> > It is... not all the objects have a persistent RESTful URI.

> It would be nice if the URL resolver would be kind of WeakDictionary to
> remove such an object automatically, but many Smalltalks are weak here,
> so I gave up that idea quite early.

What kind of problems you had?

A WeakDictionary seems to be a naive solution, but effective.


Regards,

--
Esteban.
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Transient objects URI

Janko Mivšek
Esteban A. Maringolo wrote:

>>> How do you manage the url of transient objects?
>>>
>>> It is... not all the objects have a persistent RESTful URI.
>
>> It would be nice if the URL resolver would be kind of WeakDictionary to
>> remove such an object automatically, but many Smalltalks are weak here,
>> so I gave up that idea quite early.
>
> What kind of problems you had?
>
> A WeakDictionary seems to be a naive solution, but effective.

Depends of the Smalltalk you use. It can be effective in VisualWorks but
in Squeak people reports lots of problems while on Gemstone you don't
have Weak collections at all.

Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Transient objects URI

Esteban A. Maringolo
Janko:

Did you have to deal with issues like this? Or you found a workaround?

Best regards,

Esteban A. Maringolo
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Transient objects URI

Janko Mivšek
H Esteban,

Esteban A. Maringolo wrote:

> Did you have to deal with issues like this? Or you found a workaround?

I solve the problem with weak collections simply by avoiding using them.

Also I almost always use not transient but persistent domain objects,
which usually are not deleted much over time. When if you delete it,
then you need to be careful to remove it from URL resolver too. But this
annoyance costs less that all those annoyance with weak collection
finalization problems over all supported Smalltalks.

Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida