Connecting Tech Pros Worldwide Forums | Help | Site Map

design Pattern of Classes

andrew.smith.cpp@gmail.com
Guest
 
Posts: n/a
#1: Jun 27 '08
Whts the Design pattern of the Classes?


Victor Bazarov
Guest
 
Posts: n/a
#2: Jun 27 '08

re: design Pattern of Classes


andrew.smith.cpp@gmail.com wrote:
Quote:
Whts the Design pattern of the Classes?
>
<shrugI've never heard the expression. Perhaps you're asking about
the software design patterns, see the book by Erich Gamma et al., or
post to 'comp.software.patterns'.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
andrew.smith.cpp@gmail.com
Guest
 
Posts: n/a
#3: Jun 27 '08

re: design Pattern of Classes




Victor Bazarov wrote:
Quote:
andrew.smith.cpp@gmail.com wrote:
Quote:
Whts the Design pattern of the Classes?
>
<shrugI've never heard the expression. Perhaps you're asking about
the software design patterns, see the book by Erich Gamma et al., or
post to 'comp.software.patterns'.
Thanks Victor
i m asking how to design a class in the "C++ Code"
Pascal J. Bourguignon
Guest
 
Posts: n/a
#4: Jun 27 '08

re: design Pattern of Classes


andrew.smith.cpp@gmail.com writes:
Quote:
Victor Bazarov wrote:
Quote:
>andrew.smith.cpp@gmail.com wrote:
Quote:
Whts the Design pattern of the Classes?
>
>>
><shrugI've never heard the expression. Perhaps you're asking about
>the software design patterns, see the book by Erich Gamma et al., or
>post to 'comp.software.patterns'.
Thanks Victor
i m asking how to design a class in the "C++ Code"
You would design it like in any other OO programming language. Of
course, there may be some more C++ specific idioms, like the RAII
idiom, (http://en.wikipedia.org/wiki/RAII), but there's nothing
really specific to C++.
http://en.wikipedia.org/wiki/Design_...ter_science%29


If the question is how to write a class in C++, then you'll have to
learn the C++ syntax. Basically, you write:

class NameOfClass : public NameOfSuperClass {
public:
NameOfClass();
virtual ~NameOfClass();

virtual ResultType otherMethod(...);
...

protected:

AttributeType attributeName;
...
};

NameOfClass::NameOfClass(){
// code of constructor
}

NameOfClass::~NameOfClass(){
// code of destructor
}

ResultType NameOfClass::otherMethod(...){
// code of method
}


--
__Pascal Bourguignon__
Victor Bazarov
Guest
 
Posts: n/a
#5: Jun 27 '08

re: design Pattern of Classes


andrew.smith.cpp@gmail.com wrote:
Quote:
>
Victor Bazarov wrote:
Quote:
>andrew.smith.cpp@gmail.com wrote:
Quote:
>>Whts the Design pattern of the Classes?
>>>
><shrugI've never heard the expression. Perhaps you're asking about
>the software design patterns, see the book by Erich Gamma et al., or
>post to 'comp.software.patterns'.
Thanks Victor
i m asking how to design a class in the "C++ Code"
That's a very generic question. What C++ book are you currently
reading? Any at all? Most of the books talk about design at least to
some extend. I, many year ago, found "Advanced C++" by Coplien to be of
great help in that particular area. Also, some general OOD and OOA
books should help; ask about them in 'comp.object'. You will have to
tell them that you're just starting in the field (at least that's the
impression I got).

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Closed Thread