Confused About WorkItem

Topics: CAB & Smart Client Software Factory
Nov 24, 2006 at 2:20 PM
originally posted by: bekit4

hi all,

1-can any one instruct me in a clear detailed way on how the different workitems (root , child) interact together plz.
Nov 28, 2006 at 1:50 AM
originally posted by: UberPhucker

Well they don't really interact that much actually (as far as i can tell). As far as i can tell they have a couple of primary fuctions

- They define Scope in your application. For instance if you register a service at a root workitem. the services will be available in all its child workitems. You can inject it at any level or replace it at any level.
- Its a lifetime container, if you add services or items to its container, it wil be torn down when the workitem is Terminate()'ed.
- They are entry points for launching sub workitems, or starting views.

As far as i can tell there are 2 major interactions poiints between workitems (root and child)
-> When an WorkItem gets terminated it recursvely terminates all the child work items
-> When an workitem asks for an service, object etc its recursifly looked upon back to the root workitem

Furthermore, the objectbuilder does most of the magic ;)