Re: Java Design Style - Webapps

Discussion in 'Java' started by Kent Paul Dolan, Aug 27, 2003.

  1. "Ed Thompson" <> 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
     
    Kent Paul Dolan, Aug 27, 2003
    #1
    1. Advertising

  2. "Kent Paul Dolan" <> wrote in message news:<>...
    > "Ed Thompson" <> 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
     
    Yar Hwee Boon, Aug 27, 2003
    #2
    1. Advertising

  3. Kent Paul Dolan

    David Yutzy Guest

    Would you be able to post an example of this?

    On 8/27/03 2:56 AM, in article
    , "Yar Hwee Boon"
    <> wrote:

    > "Kent Paul Dolan" <> wrote in message
    > news:<>...
    >> "Ed Thompson" <> 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
     
    David Yutzy, Aug 27, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Deasun O'Donnachadha

    How To? Reload webapps main page.

    Deasun O'Donnachadha, Jul 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    406
    S. Justin Gengo
    Jul 29, 2003
  2. =?Utf-8?B?S2VubmV0aA==?=

    IIS with webapps

    =?Utf-8?B?S2VubmV0aA==?=, Oct 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    370
    =?Utf-8?B?S2VubmV0aA==?=
    Oct 20, 2004
  3. =?Utf-8?B?T2xlZw==?=

    passing object between two webApps on the same server

    =?Utf-8?B?T2xlZw==?=, Jun 15, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    441
    Bruce Barker
    Jun 15, 2005
  4. Ken Varn
    Replies:
    0
    Views:
    525
    Ken Varn
    Apr 26, 2004
  5. Steve
    Replies:
    3
    Views:
    186
    markspace
    Oct 30, 2013
Loading...

Share This Page