Additional Quickstart - Modules and Startup

Topics: CAB & Smart Client Software Factory
May 8, 2005 at 3:01 PM
originally posted by: EdJez

One quickstart our first drop did not have was one that shows how the whole module loading system works, for applications that are based on plug-ins.

I did a simple one on Friday while ironing out our first drop, but before releasing it, I'd like to know, what would you like to see in it? Here are some things I did, and further ideas.

- Having two modules
- One module does nothing but declares a service to adde automatically to the host
- Another module shows a messagebox on startup and calls the service previously mentioned

This illustrates how to initialie the host using the ApplicationHostFactory and the ApplicationHost.Initialize methods, how to populate a SolutionProfile.xml file with the info about both modules, and how to declare a service using the Service attribute.

Additional things we could show is:
- how to replace a service with a custom service (e.g. replace the authentication with a "Make pretend" authN dialog, or replace the catalog with one that uses reflection to automatically find modules in the folder. The latter one seems appealing since it's a feature that folks have asked for.
- how to add services programatically to the host
- how the modules can add UI Elements on startup


thoughts? what wuld you like to see?
If folks chime in I'll tweak the quickstart and release it.
May 10, 2005 at 5:00 AM
originally posted by: makipera

Hi,

We had a little discussion here and we agreed that a quickstart with two modules (A and B) would be suitable. The service created by module A is added to the host. Module B will access the service created by Module A. We want to see this in your example.

Is it possible to have services added to a work item overriding a service in the host? The children of the work item use this overridden service instead of the global one. Does this make any sense?

Examples of adding services, programmatically and through the Service attribute in conjunction with the SolutionProfile.xml file, would be great! How do you change and/or remove services run-time?

How about showing nested/hierarchical work items?

Have you discussed the naming of the module? In my opinion a module is a way to package a set of controllers and smart parts to a working unit. But today the name module is also used when providing initializer-code for a module. Could you show the correct way to have a module and its initializer with proper naming?

/Kai
May 21, 2005 at 11:09 PM
originally posted by: MichaelBouck

I'm interested in the reflection loading usecase as this would facilitate a loosely-coupled plug-in architecture. Even more powerful would be the ability to publish a module manifest and associate it with role-based security. The shell could then start, grab/update the appropriate modules from some central repository -- more of a policy push and pull model instead of pushing everything out all at once. Not sure how ClickOnce would fit into this picture but it would be pretty cool. I'm interested in using the CAB for building a sort of corporate-wide portal shell that would host any/all of our internal app needs (e.g. MMC). The trick then is how to centrally manage the content/configuration....
May 24, 2005 at 5:16 AM
originally posted by: headlam

This is very interesting. I also wonder what the impact of deployment and updating via ClickOnce would have on this scenario. We refer to this approach as entitlement in our company.
May 24, 2005 at 5:21 AM
originally posted by: headlam

Ed

A sample that demonstrates the loading of two (2) modules would be suffice as one can extrapolate from there.

Having one module override the service registered by another service is also a good think to demonstrate. Is this not possible or can you only override a default service that comes with the CAB?

Demonstrating how to add a UI element on startup would also be good. Showing how to programmatically add a service, while nice to see, to see is not essential if it will delay the quick start sample.

It would also be good to see (know) how one can affect the module loading order – or will the dependency injection process figure that out? One additional item I would also like to see is the loading of a module as a pop-up (i.e., separate window) and not an embedded control in the main host.
Sep 21, 2005 at 2:16 AM
originally posted by: tolga

hi,
an example loading 2 modules with one including a service and the other using the service. i have tried to build such an application but when i initialize my smartpart, an exception is thrown saying that my controlller (which is using the service) needs the service, but it couldn't be found in the container. how many containers are there? if i step through the code in Host.initialize() i see that the service is loaded into the service host.

if i explicitly try to load the service in main(), it says that the service is already loaded..
what am i missing?
an example would be very helpful...
Sep 22, 2005 at 4:59 AM
originally posted by: jnicholsonfl1

I would like to see an example of adding a whole module programmatically. I am building an app using CAB in which I want to allow the user to add or remove modules at run time. I will initially have a default module loaded on startup that contains UI Elements for basic functionality. Using a drag/drop event model, I will then retermine when the user has added a new module, after which the code will add the necessary controller, wrok items, etc. Is this feasible?