470,848 Members | 1,569 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

design Pattern of Classes

Whts the Design pattern of the Classes?

Jun 27 '08 #1
4 1263
an**************@gmail.com wrote:
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
Jun 27 '08 #2


Victor Bazarov wrote:
an**************@gmail.com wrote:
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"
Jun 27 '08 #3
an**************@gmail.com writes:
Victor Bazarov wrote:
>an**************@gmail.com wrote:
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__
Jun 27 '08 #4
an**************@gmail.com wrote:
>
Victor Bazarov wrote:
>an**************@gmail.com wrote:
>>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
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Patchwork | last post: by
3 posts views Thread by Omer van Kloeten | last post: by
4 posts views Thread by FluffyCat | last post: by
6 posts views Thread by Daniel Santa Cruz | last post: by
2 posts views Thread by Mike | last post: by
10 posts views Thread by vital | last post: by
3 posts views Thread by aaragon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.