Connecting Tech Pros Worldwide Help | Site Map

design Pattern of Classes

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 27th, 2008, 04:43 PM
andrew.smith.cpp@gmail.com
Guest
 
Posts: n/a
Default design Pattern of Classes

Whts the Design pattern of the Classes?


  #2  
Old June 27th, 2008, 04:43 PM
Victor Bazarov
Guest
 
Posts: n/a
Default 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
  #3  
Old June 27th, 2008, 04:43 PM
andrew.smith.cpp@gmail.com
Guest
 
Posts: n/a
Default 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"
  #4  
Old June 27th, 2008, 04:43 PM
Pascal J. Bourguignon
Guest
 
Posts: n/a
Default 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__
  #5  
Old June 27th, 2008, 04:43 PM
Victor Bazarov
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.