Re: [xwiki-devs] [xwiki-notifications] r25362 - in contrib/people: . fmancinelli fmancinelli/xwiki-command fmancinelli/xwiki-command/src fmancinelli/xwiki-command/src/main fmancinelli/xwiki-command/src/main/java fmancinelli/xwiki-command/src/main/jav
On Mon, Nov 30, 2009 at 10:00 AM, Fabio Mancinelli <[email protected]> wrote:
On Nov 30, 2009, at 3:08 AM, Sergiu Dumitriu wrote:
Why do you pass the component manager around? Each component implementation can declare a dependency on ComponentManager if it needs it.
+ String execute(ComponentManager componentManager, String... arguments) throws Exception; +}
Right. It's a leftover because before I wasn't implementing commands as components.
Even if you're not using Components, passing the CM is still an implementation details that should not be shown in a user-API signature. If you're not using Components you'd pass it in the constructor of your command. Thanks -Vincent
On Nov 30, 2009, at 10:10 AM, Vincent Massol wrote:
On Mon, Nov 30, 2009 at 10:00 AM, Fabio Mancinelli <[email protected]> wrote:
On Nov 30, 2009, at 3:08 AM, Sergiu Dumitriu wrote:
Why do you pass the component manager around? Each component implementation can declare a dependency on ComponentManager if it needs it.
+ String execute(ComponentManager componentManager, String... arguments) throws Exception; +}
Right. It's a leftover because before I wasn't implementing commands as components.
Even if you're not using Components, passing the CM is still an implementation details that should not be shown in a user-API signature. If you're not using Components you'd pass it in the constructor of your command.
Yes. Thank you for the remark Vincent. -Fabio
participants (2)
-
Fabio Mancinelli -
Vincent Massol