[Seaside] Storing WAComponent / WATask etc. in magma

Florian Obser florian at narrans.de
Tue Dec 23 11:48:33 UTC 2008


Hi all,

I'm writing a seaside application in which I'm modeling the access a
logged in user has on various object as views / tasks on collections (or
subsets of collections) which are stored in magma.

e.g. in terms of a blog application: blog posts are stored in magma in a
collection. The master user has access to all posts but rather than
having an instance variable which holds a collection of blog posts the
user has an instance variable which holds a view on the blog posts to
which this user has access. This view is a subclass of WAComponent or in
case of editing / creating a new blog post a subclass of WATask. (Other
users have views which operate on different subsets of the blog posts
collection, but I can have a second master user simply by providing a
view on all posts). I hope this makes sense...

At first I stored these components / tasks in magma but it didn't work.

I changed the design and created a new class hierarchy subclassing
Object  and stored these objects in magma. These new classes essentially
store configuration data for the different views and provide a single
message which creates a new WAComponent (or task).

Later I noticed two thinks:

1) The reason why my application didn't work as expected probably hat
   nothing to do with storing the components in magma
2) I'm creating two class hierarchies which do essentially the same,
   there is one class to store the view in magma (subclassing Object)
   and another class subclassing WAComponent to create the view.

Before changing everything back (this will be a lot of work) and storing
WAComponents in magma I wanted to ask first if this will work? Do I have
to expect some strange behavior? Is this a good idea[tm]?

Thanks,

Florian


More information about the seaside mailing list