[Yanel-dev] architecture burdens
Evaldas Taroza
etaroza at optaros.com
Fri Jan 25 17:44:12 CET 2008
Hi,
I have some doubts about the usefulness/usage of all the *.attributes.*
interfaces. I understand that they are supposed to allow the resources
to be as generic as possible. However, when I am doing something I
usually need very specific things to do, i.e. viewable resource must
only be viewed, modifieable only updated, deletable only deleted, etc.
Now, when I implement ModifiableV2, I have to implement some weired
methods, when the only useful is delete(); when I implement CreatableV2,
I have to implement many methods, although I need only create()...
So far, for Viewable resources I find BasicXMLResource most useful. It
allows to switch views, apply stylesheets etc. In other words it gives a
resource a polymorphic view, that's I think is general enough and quite
nice.
MofifiableV2 seems to be good only because it has delete(). So as I
earlier suggested, it should make sense to have Deletable interface. To
make 'modifiable' action as generic as possible it should be possible to
do that through properties.
CreatableV2 I don't understand at all. To my mind it should only have
create() method, and as with 'modifiable' generic part is done through
prescribed properties.
Hence I say that Modifiable, Creatable, Viewable, Deletable are good,
but should only have modify(), create(), getView(), delete() methods.
These methods would behave differently with respect to what properties
are set for the Resource. Therefore all these interfaces could implement
HasProperties interface which would provide property names and values.
Implementations would make a good use of those properties as well as
clients would do. (All this sounds like JCR ...).
Now I find the best practice for CRUD as follows:
C: not sure it should be easy with Creatable but looks like its even
easier with usecases
R: have a resource type extending BasicXMLResource
U: have a resource type extending ExecutableUsecaseResource
D: have a resource type extending ExecutableUsecaseResource
But if my best practice for CRUD is as listed above, then where is the
power of Yanel? It looks like all the content management projects for
every Web site will have to be heavily custom, and therefore I am not
even sure if it is easier to implement them using Yanel, or simply with
JSPs, XSLTs and Jelly.
Generally speaking, I think that the whole architecture of Yanel should
be revised and cleaned-up.
Evaldas
--
+41 79 616 53 76
Optaros - www.optaros.com
More information about the Yanel-development
mailing list