Click here to Skip to main content
15,885,365 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 5:06
mvaMarc Clifton15-May-12 5:06 
GeneralRe: Simple composition - Your thoughts? Pin
Eytukan15-May-12 18:32
Eytukan15-May-12 18:32 
QuestionDatabase Modeling - Conditional Relationships Pin
Leslie Sanford11-May-12 8:34
Leslie Sanford11-May-12 8:34 
AnswerRe: Database Modeling - Conditional Relationships Pin
R. Giskard Reventlov11-May-12 9:49
R. Giskard Reventlov11-May-12 9:49 
GeneralRe: Database Modeling - Conditional Relationships Pin
Leslie Sanford12-May-12 8:42
Leslie Sanford12-May-12 8:42 
AnswerRe: Database Modeling - Conditional Relationships Pin
Eddy Vluggen13-May-12 4:32
professionalEddy Vluggen13-May-12 4:32 
AnswerRe: Database Modeling - Conditional Relationships Pin
jschell14-May-12 9:24
jschell14-May-12 9:24 
Questionhow to design base class? Pin
wan.rui@qq.com10-May-12 17:09
wan.rui@qq.com10-May-12 17:09 
C++

today I discuss with my friends .we conculde that there is two ways design base class .
1 .we design the method whether belongs to all class or only belongs to sub-class into base-class
the code writed like that
C++
class CVehicle
{
public:
	virtual void fly()
	{
		cout<<"I'm sorry  I don't have method fly"<<endl;
	}
	virtual void Ride()
	{
		cout<<"I'm sorry  I don't have method Ride"<<endl;
	}
	virtual void Run()
	{
		cout<<"I'm sorry  I don't have method Run"<<endl;
	}
};

class CAeroplane:public CVehicle
{
public:
	void fly()
	{
		cout<<"I am a Aeroplane i can fly "<<endl;
	}

};
class CBike:public CVehicle
{
public:
	void Ride()
	{
		cout<<"I am a Bike i can Ride  "<<endl;
	}
};
class CCar:public CVehicle
{
public:
	void Run()
	{
		cout<<"I am a Car i can Run  "<<endl;
	}

};


2 .we think that sub class has its own method so we should design like that
C++
class CVehicle
{
public:

};

class CAeroplane:public CVehicle
{
public:
	void fly()
	{
		cout<<"I am a Aeroplane i can fly "<<endl;
	}

};
class CBike:public CVehicle
{
public:
	void Ride()
	{
		cout<<"I am a Bike i can Ride  "<<endl;
	}
};
class CCar:public CVehicle
{
public:
	void Run()
	{
		cout<<"I am a Car i can Run  "<<endl;
	}

};



so which way will the best way we should order ?
AnswerRe: how to design base class? Pin
walterhevedeich10-May-12 19:29
professionalwalterhevedeich10-May-12 19:29 
AnswerRe: how to design base class? PinPopular
Pete O'Hanlon10-May-12 21:52
mvePete O'Hanlon10-May-12 21:52 
GeneralRe: how to design base class? Pin
wan.rui@qq.com10-May-12 22:11
wan.rui@qq.com10-May-12 22:11 
GeneralRe: how to design base class? Pin
BobJanova15-May-12 0:48
BobJanova15-May-12 0:48 
GeneralRe: how to design base class? Pin
wan.rui@qq.com10-May-12 22:15
wan.rui@qq.com10-May-12 22:15 
GeneralRe: how to design base class? Pin
TorstenH.15-May-12 0:00
TorstenH.15-May-12 0:00 
QuestionActive Directory Pin
Franklin lloyd10-May-12 7:13
Franklin lloyd10-May-12 7:13 
AnswerRe: Active Directory Pin
jschell10-May-12 9:27
jschell10-May-12 9:27 
QuestionSingle web solution vs web app + mobile web app Pin
logicaldna8-May-12 22:56
logicaldna8-May-12 22:56 
AnswerRe: Single web solution vs web app + mobile web app Pin
Aniruddha Loya9-May-12 7:34
Aniruddha Loya9-May-12 7:34 
GeneralRe: Single web solution vs web app + mobile web app Pin
logicaldna9-May-12 17:22
logicaldna9-May-12 17:22 
SuggestionRe: Single web solution vs web app + mobile web app Pin
Aniruddha Loya10-May-12 10:50
Aniruddha Loya10-May-12 10:50 
AnswerRe: Single web solution vs web app + mobile web app Pin
RobCroll18-May-12 3:23
RobCroll18-May-12 3:23 
QuestionDOC/View/Mainframe or does it matter? Pin
BarryPearlman8-May-12 11:52
BarryPearlman8-May-12 11:52 
AnswerRe: DOC/View/Mainframe or does it matter? Pin
Pete O'Hanlon8-May-12 11:59
mvePete O'Hanlon8-May-12 11:59 
QuestionASP.net Duobt Pin
SureshBabu S5-May-12 18:29
SureshBabu S5-May-12 18:29 
AnswerRe: ASP.net Duobt Pin
OriginalGriff5-May-12 19:30
mveOriginalGriff5-May-12 19:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.