Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: Java Design Style - Webapps

Reply
Thread Tools

Re: Java Design Style - Webapps

 
 
Kent Paul Dolan
Guest
Posts: n/a
 
      08-27-2003
"Ed Thompson" <(E-Mail Removed)> wrote:


> Looking at the sample Maverick webapps, I found that the developer had
> placed the std 'get' funcions in one class, and the 'set' functions in a
> second class that inherited from the first. I was intrigued by this,and
> wondered if this was a std approach, and if so, why?


Don't know if it is "standard", but the "why" is pretty easy:

if your client class using the functionality is a pure data consumer,
only the parent class need be used, and the "setter" functions
are not available and therefore not usable to create mischief;

if the functionality user is a data producer as well as a consumer,
then the child class is the appropriate one to use, and the fuller
functionality will be available.

Doing the partitioning the other way around wouldn't let things
work like this.

Sticking both getters and setters in one class wouldn't make it easy
to hand along the read only functionality where that was appropriate.

xanthian.



--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
 
Reply With Quote
 
 
 
 
Yar Hwee Boon
Guest
Posts: n/a
 
      08-27-2003
"Kent Paul Dolan" <(E-Mail Removed)> wrote in message news:<7c9bbbd0247a519f749d0d5b0671305d.48257@mygat e.mailgate.org>...
> "Ed Thompson" <(E-Mail Removed)> wrote:
>
>
> > Looking at the sample Maverick webapps, I found that the developer had
> > placed the std 'get' funcions in one class, and the 'set' functions in a
> > second class that inherited from the first. I was intrigued by this,and
> > wondered if this was a std approach, and if so, why?

>
> Don't know if it is "standard", but the "why" is pretty easy:
>
> if your client class using the functionality is a pure data consumer,
> only the parent class need be used, and the "setter" functions
> are not available and therefore not usable to create mischief;
>
> if the functionality user is a data producer as well as a consumer,
> then the child class is the appropriate one to use, and the fuller
> functionality will be available.
>
> Doing the partitioning the other way around wouldn't let things
> work like this.
>
> Sticking both getters and setters in one class wouldn't make it easy
> to hand along the read only functionality where that was appropriate.
>
> xanthian.



If interfaces were used instead, write-only will have been possible
also, any particular reason why they were not?

Hwee Boon
 
Reply With Quote
 
 
 
 
David Yutzy
Guest
Posts: n/a
 
      08-27-2003
Would you be able to post an example of this?

On 8/27/03 2:56 AM, in article
http://www.velocityreviews.com/forums/(E-Mail Removed), "Yar Hwee Boon"
<(E-Mail Removed)> wrote:

> "Kent Paul Dolan" <(E-Mail Removed)> wrote in message
> news:<7c9bbbd0247a519f749d0d5b0671305d.48257@mygat e.mailgate.org>...
>> "Ed Thompson" <(E-Mail Removed)> wrote:
>>
>>
>>> Looking at the sample Maverick webapps, I found that the developer had
>>> placed the std 'get' funcions in one class, and the 'set' functions in a
>>> second class that inherited from the first. I was intrigued by this,and
>>> wondered if this was a std approach, and if so, why?

>>
>> Don't know if it is "standard", but the "why" is pretty easy:
>>
>> if your client class using the functionality is a pure data consumer,
>> only the parent class need be used, and the "setter" functions
>> are not available and therefore not usable to create mischief;
>>
>> if the functionality user is a data producer as well as a consumer,
>> then the child class is the appropriate one to use, and the fuller
>> functionality will be available.
>>
>> Doing the partitioning the other way around wouldn't let things
>> work like this.
>>
>> Sticking both getters and setters in one class wouldn't make it easy
>> to hand along the read only functionality where that was appropriate.
>>
>> xanthian.

>
>
> If interfaces were used instead, write-only will have been possible
> also, any particular reason why they were not?
>
> Hwee Boon


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single Sign On - Transfer of credential between webapps.... aure_bobo@yahoo.fr ASP .Net 5 09-19-2005 12:14 PM
passing object between two webApps on the same server =?Utf-8?B?T2xlZw==?= ASP .Net 2 06-15-2005 07:23 PM
IIS with webapps =?Utf-8?B?S2VubmV0aA==?= ASP .Net 2 10-20-2004 10:41 PM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
How To? Reload webapps main page. Deasun O'Donnachadha ASP .Net 1 07-29-2003 03:03 PM



Advertisments