No, isHuman()is an acceptable name for a getter.

getXXX, setXXX and isXXX (for boolean properties) are all valid. You can
also use indexed properties getXXX(int i) etc.

http://java.sun.com/products/javabeans/docs/spec.html

However, beans being processed by the view should be simple value objects
(Data Transfer Objects). A class that is checking the database sound like
part of the business or data access layers.

http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html

Steve

> -----Original Message-----
> From: Benjamin Stewart [mailto:[EMAIL PROTECTED]
> Sent: June 29, 2003 6:01 PM
> To: Struts Users Mailing List
> Subject: Re: Sturts - Custom Tags and limitations
>
>
> Just strange that I have always thought of a setter and getter with
> reference to setting or getting a class field.
>
> But if I have a get function that is in a bean that is not used in
> reference to a particular field, feels wrong to me.
>
> For example I have a class person which has field name I am happy to
> have getName, setName. But if I have a function called isHuman which
> runs off and check my database which contains a list of humans, if it
> was to be bean accessible I would have to call it getIsHuman  right ??
>
> Ben



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to