just implementing command pattern and wonder where should I place ConcreteCommand implementations in package hierarchy.
http://en.wikipedia.org/wiki/Command_pattern
Should I keep them close to Command, Receiver, or Client?
let’s say app has this package structure
app.client.
app.services.
app.services.service1.
app.services.service2.
app.command.
I want to create commands for
app.services.service1.Service1
app.services.service1.Service2
So where should I create those commands. Under app.command? or under app.client? or close to each service?
EDITED: with close I mean, under packages like
app.client.commands.
app.command.commands.
app.services.service1.commands.
app.services.service2.commands.
app.services.commands.
What is the best practice here?
I suppose it is more matter of style, so what is your opinion?
thanks.
Since it is used by the client and the service I would put it under neither. Instead I would use a different package or even a different module which they can both access.