Re: fuzzy object question.
From: Robert C. Martin (unclebob_at_objectmentor.com)
Date: 03/18/04
- Next message: Robert C. Martin: "Re: fuzzy object question."
- Previous message: Robert C. Martin: "Re: Second Dimension of Object Oriented Modelling"
- In reply to: jd: "Re: fuzzy object question."
- Next in thread: Randy A. Ynchausti: "Re: fuzzy object question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Mar 2004 12:07:43 -0600
On Thu, 18 Mar 2004 09:35:25 +0100, "jd"
<jedrzej_dudkiewicz@poczta.interia.pl> wrote:
>
>"Robert C. Martin" <unclebob@objectmentor.com> wrote in message
>> Fuzziness is the ability to be in more than one mutually exclusive set
>> at the same time. In a non-fuzzy world, water is either hot or cold.
>> It is either a member of the hot set, or the cold set, but not both at
>> the same time. In the fuzzy world, an instance of water might be a
>> 20% member of the cold set and an 80% member of the hot set.
>>
>> One might model this as:
>>
>> class Water {
>> public:
>> double isHot(); // returns a number between 0 and 1.
>> };
>>
>Hmm... Wouldn't it be better to return temperature and let the "peer"
>decide, whether or not it's hot ? Water don't know, if it's hot or cold, am
>I right ? Just as people don't know, if they are pretty or ugly (except of
>extreme cases, I think). Just a proposition, I'm not very good at modeling
>such things. Besides, this is what AndyW proposed between the lines, I
>think.
That depends on whether you want the members to know their membership,
or the sets to know the membership of their members. Certain
applications will want one view, others will want the other.
So you could model it this way:
public class HotWaterSet {
public double isMember(Water w); // returns value in range [0,1]
}
- Next message: Robert C. Martin: "Re: fuzzy object question."
- Previous message: Robert C. Martin: "Re: Second Dimension of Object Oriented Modelling"
- In reply to: jd: "Re: fuzzy object question."
- Next in thread: Randy A. Ynchausti: "Re: fuzzy object question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|