Click here to Skip to main content
11,632,260 members (69,807 online)
Rate this: bad
Please Sign up or sign in to vote.
Can u assure me Smile | :) :
I have implemented my version of the command pattern.
At this moment the commands do this:

JojoCommand() : ICommand
   private Jojo pJojo;
   private Color pColor;
   private JojoMaster pJojoMaster;
   public JojoCommand(JojoMaster jojoMaster,Jojo jojo, Color color)
      pJojoMaster = jojoMaster;
      pJojo = jojo;
      pColor = color;
   public Execute()

So JojoMaster has some subclasses (chris,peter,harry).
Cause i was getting to many commands to Do.

At this moment ,in execute() : i hardcode subclassed chris,peter and harry in each command :

But now i want to have a plugin model in pJojoMaster , meaning i could have a mila,millie,mathilda too , loaded at runtime.

So JojoMaster should have 1 single command : DoCommand(string CommandName , commandArgs args). And jojomaster would then delegate that to his plugins , that each would have a DoCommand too. Jojomaster would check each loaded subclass if it could take the command , and when found , execute it.

But after that , i get blinded by thoughts about how to implement the args object.

Anybody had the same problem , and solved it ?

Huggies !!

Whats best to do next ?
Posted 30-Jul-10 9:04am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 8,393
1 Sergey Alexandrovich Kryukov 8,044
2 Mika Wendelius 6,260
3 F-ES Sitecore 2,321
4 Suvendu Shekhar Giri 1,970

Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 30 Jul 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100