Lukasz,
i dont't understand, why you have to load all the screens at one
time?
I build something simliar at the moment but with another approach.
I have a ModuleManager where all available Modules are registered.
The mainform and every other from that is responsable for more then
one Task implements an IWorkbench interface. A Workbench has an
associated TaskSchema. And the TaskSchema holds the TaskDefinitions
available for the Schema:
TaskSchema
----> TaskTree
----> TaskTreeNodes
----> TaskPresentationItem
----> TaskDefinition
So i can define easily how the Menu or Sidebar Structure should be,
without
making any changes to the code and wihtou interfering the model. All
TaskDefinitions are managed by a TaskRegistry. The TaskRegistry
checks
if the Task for the TaskDefinition is available in the current
context. This means
it for instance looks trough the registered Modules if there is any
Implementor for the Task available. Other ITaskAvailabilityCheckers
are
injected using castle and are responable for permission checking etc.
So after all this i have a Menu/Ribbon/Toolbar/Tree structure that
represents
the available Task's in the current context, without instantiating any
of them. If
it comes to execution, the TaskRegistry is responable for that. It
looks, if there
is any registered ITaskBuilder for the current TaskDefintion in the
container.
If so it resolves it and let it create the Task otherwise a
DefaultTaskBuilder is used.
The so instantiated Task get's the execution context and has then
access to the
IWorkbench. If the Task should display something, it simply creates a
IContenView
and shows it using IWorkbench.doAddContent(contentView). This all is
very
simple and configurable through the database (TaskDefinition,
TaskSchema) an the container
(ITaksAvailabilityChecker, ITaskBuilder etc.) and it works fine. What
i not do is to
hide the ServiceManager. I don't understand why you do this. I have
build a static
ServiceResolver with all the necessary methods, that is a facade to
the real ServiceManager
implementation, so why not use it in the hole app?
On 16 Jun., 08:11, Lukasz Podolak <[email protected]> wrote:
> I'm building a smart client app which has finite number of modules. The
> application controller is being injected with a list of all registered
> modules (actually ModuleManager(s) in my code) that are a facades to each
> module and hide their implementation behind a simple interface. Those
> ModuleManagers are injected in constructor time with all specific classes
> that are resposible for their tasks (like each builds it's own ribbon, each
> has different security permissions, etc)
>
> But there is a single, heavy dependency for each ModuleManager that is a
> representation of the actual screen (with heavy, 3rd party vendor's
> controls) - I use an interface segregation so that I can operate on
> displaying the screen in my logic without touching any Windows.Forms.* The
> implementation for this interface however is the actual screen (User
> control).
>
> Once this dependencies are resolved there is too big memory consumption
> jump when not particularly needed. As I said I'm instantiating all
> ModuleManagers at the beginning (so that I can for example choose which one
> can be used and appended to the ribbon) but I don't necessarily want to load
> all screens at one time ? I need only one, and the rest could be
> instantiated only when accessed.
>
> I know I could lazy load this manually but I'm trying to keep no reference
> to my ServiceLocator in the Logic module - I only keep a clean classes that
> are full of constructor injection.
>
> This is my first smartclient project (i'm definitely more a web-guy) so I
> may not get something correctly in terms of structuring the application.
> If I do something wrong, I'm happy to be corrected.
> thanks
>
> 2009/6/15 Krzysztof Koźmic <[email protected]>
>
>
>
> > Lukasz,
>
> > What exactly are you trying to do?
>
> > 2009/6/15 Lukasz Podolak <[email protected]>:
>
> > > On Mon, Jun 15, 2009 at 6:58 PM, Bill Barry <[email protected]>
> > wrote:
>
> > >> I would do this in a similar manner to how lazy loading is done within
> > >> NH...
>
> > > thanks guys, I will try this approach
> > > ł.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---