New Posts New Posts RSS Feed: IModule and ModuleInit
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

IModule and ModuleInit

 Post Reply Post Reply
Author
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Topic: IModule and ModuleInit
    Posted: 01-Aug-2007 at 11:39am
The IModule interface has two methods: AddServices() and Load().  The two methods are implemented in the ModuleInit abstract class.  The SalesRepModule class overrides only the Load() method.  The AddServices() method is not implemented.  Is there a reason why Cabana chooses not to implement that method but rather introduce a new AddServices() method into the controller class?
 
Thanks,
Bill
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 01-Aug-2007 at 1:11pm
Here is a followup to the original question:
 
There are five methods expressed in the controller run command--
 
AddServices()
ExtendMenu()
ExtendToolStrip()
AddViews()
AddPageSubscriptions()
 
The middle three are static methods.  Why are these static and the other two are not?  Or, should the other two be declared static, as well?
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 01-Aug-2007 at 4:31pm
The Module class has access to the parent workitem only.  There it would be appropriate to add services that need to be accessible to other modules.
 
The module controller has access to the module's workitem and can add services (and other items) that should be local to the module (and its child workitems).
 
The three static methods you mention are empty.  Methods that do not depend on the members of the class are often marked static to avoid the overhead of passing the instance reference.  FxCop suggests this and ReSharper may do it automatically. 
 
Bill J.
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 01-Aug-2007 at 5:18pm
Gotcha...thanks!!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down