struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Palamadai Sriram" <palamadai.sri...@s1.com>
Subject RE: Interfaces vs base classes
Date Mon, 13 Nov 2000 18:06:35 GMT
Error : Iam not allowed to use Java script , hope that clarifies

-----Original Message-----
From: Palamadai Sriram [mailto:palamadai.sriram@s1.com]
Sent: Monday, November 13, 2000 12:45 PM
To: struts-dev@jakarta.apache.org
Subject: RE: Interfaces vs base classes


Hello Matthias,
Iam having a problem of major proportions here , would be very thankful if
you could help me out.
Iam trying to have validations for each individual JSP and not having to go
to the action class every time. Ideally I would like the validations to be
done on the JSP could use a bean on the JSP(automatically set the fields in
the bean) validate it by calling my validator class and pass to the next JSP
page.This way I call the action class only in the last JSP when I will
perform my Business logic and forward to the next jsp/virtual path. I am
allowed to use Java script and all the validation is for the Client Side
only.Any suggestions will be welcome.
Ram

-----Original Message-----
From: Matthias Kerkhoff [mailto:make@BESToffers.de]
Sent: Monday, November 13, 2000 9:36 AM
To: Cedric Dumoulin
Subject: Re: Interfaces vs base classes


Hi Cedric,

>  For my point of view, it seem that using base classes
> rather than interfaces close some doors in this case : With a base
> class, you "have to" extends the class, which forbid any others classe
> inheritances. But, an ActionForm is used to expose properties from, lets
> say, business logic objects (BO). So, you must implement your action
> form with a delegate of your BO. If later you modify your BO
> (customization for a new client), you need to modify your action form.
> This will not happen if your action form can extend the BO (or its data
> representation), and use a delegate for the ActionForm interface. So,
> why closing this possibility ? Do I miss something ?

I have the same problem and would prefer the more flexible solution
that Sun has choosen for such situations. As an example, I would like
to mention Tag/TagSupport or BeanInfo/SimpleBeanInfo.
Having a mandatory interface and a optional base class leaves the
decision to the developer.
He/she can choose either
- to implement the interface, if full flexibility is needed, or a base
  class already exists; or otherwise
- to extend the default base class and minimize the own development efforts.

However, there has been a long discussion  some weeks ago on this list
(or was it in Struts-Users?), if ActionForm should be a base class or
an interface. It's probably not a good idea to restart this thread again.

--
Matthias                        (mailto:make@BESToffers.de)



Mime
View raw message