On Wed, 15 Jan 2003, K.Viswanathan wrote:
> Date: Wed, 15 Jan 2003 11:15:49 +0530 > From: K.Viswanathan <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: Struts Users Mailing List <[EMAIL PROTECTED]> > Subject: Re: changing ActionForm to be a Java interface > > In this example, assuming that the employee id is long ( or for that matter > any other attribute of Employee , say age of int type ) , then will it not > be incorrect to have the EmployeeForm implementing Employee interface? > Doing so the EmployeeForm is basically having a property of long/int type > rather than a String? > That's exactly one of the problems you would run into if ActionForm were an interface. The underlying class would want the id property to be a long, but the form bean wants it to be a String. The only way around that in a single class would be to use two different property names (id and idAsString perhaps) and remembering to do the conversion at the right time -- which pretty much defeats the reason for making a single class implement both interfaces anyway. > Thanks > Vishy Craig -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

