Hi Cédrick,
To sum up, I have an attribute which is a container
(wrapper) that
points to an object model (domain) and to an analysis element (a
simple object that has a value)
nb: for now I have two parallel hierarchies. One for ExpAttributes
and one for the domain objects.
ExpAttribute
model:= aMAPerson
analyse:= anAnalyse
All my domain objects are meta described as the analyse one.
So now I have an experience that is composed of ExpAttribute and
for these I'd like to dynamically generate the description what is
not so easy as the model element is not of the same type for all
ExpAttribute (I only differentiate Attribute that are Leaf
(equivalent to Magritte descriptions minus
MARelationDescription...) and those that are composed (equivalent
to MARelationDescription)).
Whereas on your slides, "dynamic descriptions" are build from
existing descriptions on class side, here I need to build them
according to the object wrapped in the ExpAttribute>>model
Mhh ... it is a bit hard to understand how the objects play together,
maybe some diagram could help to understand your object model?
So that is why I was interested in description
generation. Is it
possible for instance to overwrite description like:
Model>>description
container := super description <- return a MAPriorityContainer
container add: aNewDescription etc...
Yes, it is common to do something like this. You can always override
#description on the class- or on the instance-side of any model.
I had a problem because descriptions are added over
and over after
each new session because MACachedBuilder keeps a cache with the
previous descriptions.
Hehe, I thought I said that somewhere in the slides: you have to
manually make a copy of your original description, else you modify
the original description that is cached by Magritte.
Model>>description
container := super description copy.
container add: aNewDescription
What is the purpose of MACachedBuilder instead of
MABuilder?
avoiding creating descriptions over and over?
Yes, the current way of creating descriptions is not really
efficient. I have to manually collect and compose the descriptions
from special methods, taking inheritance and overrides into play,
etc. This will become simpler as soon as Pragmas will be standard in
Squeak ;-)
Model>>description
^MASpecificBuilder new build: self
So before going further, can you tell me if it is a good practice
- to redefine description on the instance side ?
- to use a specific builder ?
Is there a better way to create dynamically descriptions according
to the Magritte framework (when some descriptions are accessible in
the class side and others in class side of other objects class
side...)...
Yes, you can do that. It is possible hook for Magritte, however I
never really used it myself. I prefer to do static stuff in methods
on the class-side and let Magritte cache it, and to do dynamic stuff
on the instance-side and take a copy of what Magritte returns as a
prototype.
Maybe I should do that with a MAScafolder ??
Yes, MAScaffolder is doing it the way I described.
I ve tried to adapt what Michel Bany did (http://
cdrick.seasidehosting.st/seaside/LiveTests the scrollbar) to
the new renderer to have a MARangeComponent compatible with all
browser but without success... Does it seems possible to you
as it uses some functions of seaside Async ? anyway, I'll see
that point later...
No, MARangeComponent only works in KHTML based browsers, such as
Safari or Konqueror. It is based on the draft of the next XHTML
standard and it gently degenerates to a plain input box if not
supported.
Yes I knew that... but what I tried was to adapt the scrollbar
component as provided in the exemple (http://
cdrick.seasidehosting.st/seaside/LiveTests) to WARenderCanvas. It's
a live div but Michel Bany (I think he made that) did it for
WAHtmlRenderer.
I never worked much with the Seaside life framework. I do only
advertise script.aculo.us and they have a slider that works pretty
well, it is not integrated into Seaside yet but that should be simple.
I don't
use SeasideAsync, there are a few experimental controls
using script.aculo.us. This library works nicely together with
seasides canvas framework and would also provide a cross-browser
compatible slider, that could be integrated if I (or somebody
else) had the time.
ok didn't know that :)
where can I find the javascript code for that ?
Demos:
http://scriptaculous.seasidehosting.st
Source:
http://www.squeaksource.com/Seaside.html
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch