On Jun 3, 2005, at 4:30 AM, Robert wrote:
Hi,
After working with tapestry a little bit I decided to find a way to
not use abstract classes anymore. They give me too much trouble. I
was hoping you people could give me some insight in the
possibilities to accomplish this.
For pages I read about the possibility to use getProperty/
setProperty to avoid abstract classes. Could anyone elobarate on this?
There really isn't much to elaborate on. You can make your classes
concrete, use <property-specification> (or <property> in Tapestry 4.0
DTD) in the specification files and simply use get/setProperty in
your Java code to work with the values. It'll work the same as the
abstract technique with getters/setters defined. You do lose some
compile-time checking, of course, but that is something we all need
to be a bit less concerned with in general :)
Also is anyone using just instance variables and using initialize
to reset them?
Doesn't sound to be too much work to do.
I would only recommend using instance variables sparingly just to
minimize the risk of overlooking the initialization/resetting of
them. But you're right, it's not really that much work.
And how would I deal with the parameters of components? How can I
avoid the abstract getters and setters for those?
Parameters of components become properties also, defaulting to the
same name. So you'd deal with them just like you would properties as
above.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]