On Tue, 2012-05-15, softwareEngineer wrote:
> Hi all,
Please wrap your lines! I have done it for you below.
> my topic is relate on C++ (because the system under maintenance is
> wrote in C++) but my issue is more on design. Would be great any your
> feedback/suggestion.
>
> I have two component, one (let愀 call it A) manage the request
> (command) from external systems and another (let愀 call it B) manage
> its own command.
>
> Once A receive one command calls one method of class B.
>
> Now I悲 like to expose only one method from B (ProcessCommand) which
> accept a abstract class (ICommand). So B have to expose one method
> ProcessCommand, ICommand and all ConcreteCommand (derived by ICommand)
> that it manage.
>
> What do you think ? there is a better way to do it ?
I personally prefer not to deal with abstract classes and run-time
polymorphism unless there is a clear need for it. What is the need in
this case?
Specific advice is impossible to give without much more details.
Remember to design properly for whatever I/O mechanism you're using.
E.g. if it's a TCP socket you're using, you cannot just pretend that
it's someone sending you Commands -- at some level you need to think
of it as a stream of octets which may arrive at thousands per second,
or once a week, be interrupted or stuck at any time, and so on.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/
snipabacken.se> O o .