A thinking about implement with interface and analysis problem by set theory.
I don't clearly know what is protect derive.
I guess the protect derive is to protect the implement detial when you
need ,at the same time, to care about that how to implement this
programming with GUI and how to analysis this problem into some concept
for you to design.
I ,by myself, study some section in the Bjane StroStroup's book "The
C++ Programming Language Special ed. ". He have example for talking
about Ival_box but I cannot ensure what
he want me to learn. So, I feeling I need to discussion some here.
After I see the section about example of Ival_box and have the
following thinking.
=======================================
My problem is about how to design a user-interface.
If I have to implement something with particular problem.
And we never analysis the problem to some concepts by set-theory.
What's user_interface to realize is that the user_interface must
support enough
functions to satisfy the requirement of impl_way1, impl_way2 and
impl_way3.
So I afford the user_interface such that all of implment ways just need
to care
about what functions in user_interface.
Now, I start to OOAD and know that
Since the user_interface have been down, suppose universe_set is the
universe set that satisfy all of implement ways(since universe_set is
derived from user_interface.)
My analysis decide that two original sets A and B.
To continue to analysis and I get
(1)C is A intersection B
(2)D is subset of C.
Thus I have the following code to described the relation about problem
and implement detial.
Why do I use the protect derive in such code "class universal_set :
public user_interface, protect impl_gateway"
My answer is that "because the protect derive cause that
all of the implement ways for this problem must not be influenced by
the analysis result in every subtype of universal_set" .
Since I think that the responsibility of user_interface is to descirbe
that
what function will be support for the implement way. Thus,
user_interface cause that
"problem analysis just only problem analysis "and "implement detail
just implement detial".
Therefore, problem analysis and implement detial is saperated to think.
class impl_way1;
class impl_way2;
class impl_way3;
class impl_gateway: public impl_way1,public impl_way2,public impl_way3{
virtual support_1()=0;
virtual support_2()=0;
virtual support_3()=0;
};
class user_interface : public impl_gateway{
virtual support_1()=0;
virtual support_2()=0;
virtual support_3()=0;
};
class universal_set : public user_interface, protect impl_gateway{
};
class set_A:public universal_set{
};
class set_B:public universal_set{
};
class set_C:public set_A, public set_B{
};
class set_D:public set_C
};
Thanks a lot!
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]