[Seaside] [ENH] HandyComponent
Avi Bryant
avi at beta4.com
Sun Mar 28 01:22:59 CET 2004
> Well, I think is useful when you want to difference the way an object
> looks depending on it's state. For instance aReservation coul be edited
> when it's open and can't when it's canceled.
> In the case of different priviledges, a user can have a set of
> athorized
> render methods to make over an object.
Oh, I certainly understand rendering a component differently depending
on some session state (which user is logged in, whether a reservation
is open or closed, etc). But that's different from a state machine,
where the component itself has a discrete set of named states that it
transitions between, as the original post described.
> Now I'm thinking, it can also
> have authorized classes (classes wich show the object in different
> ways/functionalities).
Right, I would tend to lean towards having multiple classes
(ReservationViewer vs. ReservationEditor) rather than one class that
filled both roles. You still have to have conditional logic somewhere
that chooses which class to use, of course.
The capabilities guys might have some interesting patterns to use here.
I haven't read too much of the UI-related capabilities work.
Avi
More information about the Seaside
mailing list