Click here to Skip to main content

Design and Architecture

 
AnswerRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? PinprofessionalMarc Koutzarov30-Aug-14 0:54 
QuestionClient - Server approach Pinmemberbugal21-Dec-12 1:33 
AnswerRe: Client - Server approach Pinmemberjschell22-Dec-12 15:11 
QuestionHow do you design this ? PinmemberVuNic18-Dec-12 3:33 
An object called MovableObject can move through different methods.
MoveByLegs, wheels & Wings. When we choose one method, i.e MoveByLegs and pass Legs arguments, the other two will be unused.
 

Should I design it like this:
enum MoveType
{
MoveByLegs,
MoveByWheels,
MoveByWings
}
 
class MovableObject
{
List<leg> lstLegs;
List<Wheels> lstWheels;
List<Wing> lstWings;
 
MoveType m_Movetype;
 
EnableMovement(MoveType movetype_in, object obj_in)
{
m_Movetype = movetype_in;
switch (movetype_in)
{
case MoveByLegs:
lstLegs = List<Leg>(obj_in);
break;
 
case MoveByWheels:
lstWheels = List<Wheel>(obj_in);
break;
 
case MoveByWings:
lstWings = List<Wing>(obj_in);
break;
}
 
}
 
Move()
{
if(m_Movetype == MoveType.MoveByLegs)
{
 
//  Process lstLegs
}
similar case for MoveByWheels & Legs
 
}
}

Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.

AnswerRe: How do you design this ? PinprotectorPete O'Hanlon18-Dec-12 3:47 
GeneralRe: How do you design this ? PinmemberVuNic18-Dec-12 3:54 
GeneralRe: How do you design this ? PinprotectorPete O'Hanlon18-Dec-12 4:02 
GeneralRe: How do you design this ? PinmemberLampridis Vasilis30-Dec-12 1:04 
GeneralRe: How do you design this ? PinmemberVuNic30-Dec-12 19:00 
AnswerRe: How do you design this ? Pinmemberjschell18-Dec-12 9:14 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150224.1 | Last Updated 26 Feb 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid