Click here to Skip to main content
15,910,603 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: A questing about software design methodology Pin
popchecker7-Oct-10 23:01
popchecker7-Oct-10 23:01 
GeneralRe: A questing about software design methodology Pin
Pete O'Hanlon7-Oct-10 23:50
mvePete O'Hanlon7-Oct-10 23:50 
AnswerRe: A questing about software design methodology Pin
Mycroft Holmes8-Oct-10 1:17
professionalMycroft Holmes8-Oct-10 1:17 
GeneralRe: A questing about software design methodology Pin
Megidolaon12-Oct-10 5:15
Megidolaon12-Oct-10 5:15 
GeneralRe: A questing about software design methodology Pin
RobCroll26-Dec-10 5:07
RobCroll26-Dec-10 5:07 
AnswerRe: A questing about software design methodology Pin
David Skelly8-Oct-10 2:09
David Skelly8-Oct-10 2:09 
QuestionHow can I create factory? Client can set data for methods which are not in defined in interface?(Design Problem) Pin
glitteringsound2-Oct-10 19:50
glitteringsound2-Oct-10 19:50 
AnswerRe: How can I create factory? Client can set data for methods which are not in defined in interface?(Design Problem) Pin
Sameerkumar Namdeo4-Oct-10 23:18
Sameerkumar Namdeo4-Oct-10 23:18 
      struct IParameter
      {
            int m_ID;
            virtual ~IParameter(){}
      };
      class IParameterSetter
      {
            public: 
            virtual ~IParameterSetter(){}
            virtual int SetParameter(IParameter *pParam) = 0; 
      };
      class IFactorySpecific
      {
            public:
            virtual void Execute()=0;                  
      };
      class ISubjectExecutor : public IFactorySpecific, public IParameterSetter
      {
            public:
            enum PARAMETERID
            {
                ID_CLSID,
                ID_Guids 
            };
            struct CLSID : public IParameter
            {
                CLSID(){m_ID = ISubjectExecutor::PARAMETERID::ID_CLSID;}                
                int a;
                ..... 
            };
            struct Guids : public IParameter
            {
                Guids(){m_ID = ISubjectExecutor::PARAMETERID::ID_Guids;}
                int x;
                ......
            };                    
      };

      class IWin32Executor: public IFactorySpecific, public IParameterSetter
      {
            public:
            enum PARAMETERID
            {
                ID_FilePath,
            };
            struct FilePath : public IParameter
            {
                FilePath(){m_ID = IWin32Executor::PARAMETERID::ID_FilePath;}
                char cszFilePath[260];
                ..... 
            };
      };
      class COMExecutor: public ISubjectExecutor
      {
            public:           
            //void setCLSID();
            //void setGuids();
            int SetParameter(IParameter *pParam)
            {
                switch(pParam->m_ID)
                {
                    case ISubjectExecutor::PARAMETERID::ID_CLSID : 
                    ISubjectExecutor::CLSID *pData = (ISubjectExecutor::CLSID *)pParam;
                    //...continue using pData, like pData->a
                    return ...;
                    break;

                    case ISubjectExecutor::PARAMETERID::ID_Guids : 
                    ISubjectExecutor::Guids *pData = (ISubjectExecutor::Guids *)pParam;
                    //...continue using pData, like pData->x
                    return ...;
                    break;
                }
            } 
          
            virtual void Execute(){.........}          

      };

      class Win32Executor : public IWin32Executor
      {
         public:                    
         //void setFilePath();
         //same can be done for  Win32Executor 
         int SetParameter(IParameter *pParam)
         {
              ......
              ......
         }
         virtual void Execute(){.........}          
      }; 


//using the above class structure
//fetch COMExecutor
IFactorySpecific *pExecutor = Factory::GetExecutor("COMExecutor");
//set CLSID
ISubjectExecutor::CLSID stParam;
stParam.a = 10;
pExecutor->SetParameter(&stParam); 

//fetch Win32Executor 
IFactorySpecific *pExecutor = Factory::GetExecutor("Win32Executor ");
//set FilePath
IWin32Executor::FilePath stParam;
strcpy(stParam.cszFilePath, "c:\\abc\\xyz.exe");
pExecutor->SetParameter(&stParam);       


Sameer();

QuestionGetting the right stuffing. Pin
Brian Bennett1-Oct-10 23:05
Brian Bennett1-Oct-10 23:05 
AnswerRe: Getting the right stuffing. Pin
Mycroft Holmes2-Oct-10 21:37
professionalMycroft Holmes2-Oct-10 21:37 
QuestionGetting or Setting Controls & Other hardcoded values from database Pin
meeram3952-Sep-10 19:43
meeram3952-Sep-10 19:43 
AnswerRe: Getting or Setting Controls & Other hardcoded values from database Pin
Eddy Vluggen9-Sep-10 0:36
professionalEddy Vluggen9-Sep-10 0:36 
AnswerRe: Getting or Setting Controls & Other hardcoded values from database Pin
senguptaamlan23-Sep-10 2:41
senguptaamlan23-Sep-10 2:41 
QuestionSearch and Replace Pin
mohit`1227-Aug-10 9:21
mohit`1227-Aug-10 9:21 
AnswerRe: Search and Replace Pin
Luc Pattyn27-Aug-10 15:23
sitebuilderLuc Pattyn27-Aug-10 15:23 
GeneralRe: Search and Replace Pin
mohit`122-Sep-10 2:55
mohit`122-Sep-10 2:55 
GeneralRe: Search and Replace Pin
Richard MacCutchan2-Sep-10 3:28
mveRichard MacCutchan2-Sep-10 3:28 
GeneralRe: Search and Replace Pin
Pete O'Hanlon2-Sep-10 3:41
mvePete O'Hanlon2-Sep-10 3:41 
QuestionBest UML Tool for Class Diagrams Pin
mohit`1225-Aug-10 7:21
mohit`1225-Aug-10 7:21 
AnswerRe: Best UML Tool for Class Diagrams Pin
Pete O'Hanlon25-Aug-10 9:05
mvePete O'Hanlon25-Aug-10 9:05 
AnswerRe: Best UML Tool for Class Diagrams Pin
syntaxed30-Aug-10 0:16
syntaxed30-Aug-10 0:16 
GeneralRe: Best UML Tool for Class Diagrams Pin
mohit`122-Sep-10 2:56
mohit`122-Sep-10 2:56 
GeneralRe: Best UML Tool for Class Diagrams Pin
Pete O'Hanlon2-Sep-10 3:40
mvePete O'Hanlon2-Sep-10 3:40 
Questionproject Pin
hninwuttyee23-Aug-10 23:51
hninwuttyee23-Aug-10 23:51 
AnswerRe: project Pin
Pete O'Hanlon24-Aug-10 0:03
mvePete O'Hanlon24-Aug-10 0:03 

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.