[castle][JIRA] Created: (IOC-56) Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel

1 view
Skip to first unread message

Bill Pierce (JIRA)

unread,
Jan 4, 2007, 4:41:15 PM1/4/07
to castle-pro...@googlegroups.com
Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
----------------------------------------------------------------------------------------------

Key: IOC-56
URL: http://support.castleproject.org//browse/IOC-56
Project: MicroKernel-Windsor
Issue Type: New Feature
Components: MicroKernel
Affects Versions: RC 4
Reporter: Bill Pierce
Priority: Minor


I would like to see the following functionality:

Create Parent Kernel
Add Comonent X to parent Kernel. Component X has dependencies A and B
Add Component A to parent Kernel.

Create Child Kernel
Add Component B to child Kernel.

Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel

Request Component X from parent kernel, receive component without dependency component B fulfullied.

I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://support.castleproject.org//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Bill Pierce (JIRA)

unread,
Jan 4, 2007, 4:46:14 PM1/4/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=all ]

Bill Pierce updated IOC-56:
---------------------------

Description:

I would like to see the following functionality:

Create Parent Kernel
Add Comonent X to parent Kernel. Component X has dependencies A and B
Add Component A to parent Kernel.

Create Child Kernel
Add Component B to child Kernel.

Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel

Request Component X from parent kernel, receive component without dependency component B fulfullied.

I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

was:

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

Daniel Jin

unread,
Jan 4, 2007, 7:05:18 PM1/4/07
to castle-pro...@googlegroups.com
I'm not exactly liking this feature yet.
 
I like the current way how parent-child kernel works. child kernel has the ability to use or override parent kernel's components. which to me is pretty intuitive.
 
in your scenario, what do you do when there are multiple child kernels exposing the same service. which one do you choose when resolving the parent's dependency? also, what is the advantage of using child kernels then if they can see each other's services? do you have scenario you can show how this would be useful? I'm very interested.

 

hamilton verissimo (JIRA)

unread,
Jan 4, 2007, 11:29:14 PM1/4/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=all ]

hamilton verissimo resolved IOC-56.
-----------------------------------

Resolution: Won't Fix

I cannot add this behavior. That would mean that dependency resolution will happen both ways, and this just doesn't look right. Think about it: you have multiple child containers. Any can have their own version of component B, which one should it pick?

> Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
> ----------------------------------------------------------------------------------------------
>
> Key: IOC-56
> URL: http://support.castleproject.org//browse/IOC-56
> Project: MicroKernel-Windsor
> Issue Type: New Feature
> Components: MicroKernel
> Affects Versions: RC 4
> Reporter: Bill Pierce
> Priority: Minor
>
> I would like to see the following functionality:
> Create Parent Kernel
> Add Comonent X to parent Kernel. Component X has dependencies A and B
> Add Component A to parent Kernel.
> Create Child Kernel
> Add Component B to child Kernel.
> Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel
> Request Component X from parent kernel, receive component without dependency component B fulfullied.

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

Bill Pierce (JIRA)

unread,
Jan 5, 2007, 12:18:15 AM1/5/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=comments#action_10923 ]

Bill Pierce commented on IOC-56:
--------------------------------

I guess my description wasn't clear.

When you request the component from the parent kernel it wouldn't pick anyone, it would set the property to null or it would throw an error if the component was part of the constructor. However if you request it from the child kernel it would resolve against the component in the child kernel.

Does that make sense?

> Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
> ----------------------------------------------------------------------------------------------
>
> Key: IOC-56
> URL: http://support.castleproject.org//browse/IOC-56
> Project: MicroKernel-Windsor
> Issue Type: New Feature
> Components: MicroKernel
> Affects Versions: RC 4
> Reporter: Bill Pierce
> Priority: Minor
>
> I would like to see the following functionality:
> Create Parent Kernel
> Add Comonent X to parent Kernel. Component X has dependencies A and B
> Add Component A to parent Kernel.
> Create Child Kernel
> Add Component B to child Kernel.
> Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel
> Request Component X from parent kernel, receive component without dependency component B fulfullied.

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

--

Daniel Jin

unread,
Jan 4, 2007, 11:20:07 PM1/4/07
to castle-pro...@googlegroups.com
here's a more interesting scenario for parent-child container resolution.
 
the parent container registers a component P with dependency on service with implementation S1.
the child container registers a component C with dependency on component P registered in parent container.
the child container also overrides the service with S2.
 
now I go request for C on the child container. which service, S1 or S2 you think the kernel should inject into P?
 
logically since the request is made on the child container, I'm thinking S2 should be injected. what do you think?

 
ComplexOverride.cs

Bill Pierce

unread,
Jan 4, 2007, 11:24:39 PM1/4/07
to Castle Project Development List
Hey Daniel,
My description was not clear. When you request the component from the
parent kernel, it does not search child kernels for the dependency. It
will only search the child kernel for dependencies whenever you request
the component from the child kernel.

Let's say I have an order processing component in the Parent kernel.
The order component has a dependency on the email confirmation
component that is also added to the Parent kernel. Now let's say I add
a child kernel. I add an email confirmation component to the child
kernel. Now I resolve the order processing component from the child
kernel. The order processing component is not present in the child
kernel so it resolves against the parent. When the parent is
fulfilling the dependencies, it will return the email confirmation
component from the parent kernel. My patch would change this behavior
so that it would resolve the email confirmation component from the
child, rather than the parent.

Does that make sense?

Daniel Jin

unread,
Jan 4, 2007, 11:27:07 PM1/4/07
to castle-pro...@googlegroups.com
I appologize Bill. I didn't read your whole scenario clearly the first time through and jumped the guns. then later I arrived at the same conclusion. and coming across like an idiot in the process. good work.

 

Ayende Rahien (JIRA)

unread,
Jan 5, 2007, 2:29:14 AM1/5/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=comments#action_10924 ]

Ayende Rahien commented on IOC-56:
----------------------------------

I don't think that this violates anything.
The way I see it, is it very similar to the scopes thing we discussed earlier.

> Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
> ----------------------------------------------------------------------------------------------
>
> Key: IOC-56
> URL: http://support.castleproject.org//browse/IOC-56
> Project: MicroKernel-Windsor
> Issue Type: New Feature
> Components: MicroKernel
> Affects Versions: RC 4
> Reporter: Bill Pierce
> Priority: Minor
>
> I would like to see the following functionality:
> Create Parent Kernel
> Add Comonent X to parent Kernel. Component X has dependencies A and B
> Add Component A to parent Kernel.
> Create Child Kernel
> Add Component B to child Kernel.
> Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel
> Request Component X from parent kernel, receive component without dependency component B fulfullied.

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

hamilton verissimo (JIRA)

unread,
Jan 5, 2007, 5:58:14 AM1/5/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=comments#action_10926 ]

hamilton verissimo commented on IOC-56:
---------------------------------------

Bill, what's the use case?

> Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
> ----------------------------------------------------------------------------------------------
>
> Key: IOC-56
> URL: http://support.castleproject.org//browse/IOC-56
> Project: MicroKernel-Windsor
> Issue Type: New Feature
> Components: MicroKernel
> Affects Versions: RC 4
> Reporter: Bill Pierce
> Priority: Minor
>
> I would like to see the following functionality:
> Create Parent Kernel
> Add Comonent X to parent Kernel. Component X has dependencies A and B
> Add Component A to parent Kernel.
> Create Child Kernel
> Add Component B to child Kernel.
> Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel
> Request Component X from parent kernel, receive component without dependency component B fulfullied.

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

--

Bill Pierce (JIRA)

unread,
Jan 5, 2007, 11:43:20 AM1/5/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=comments#action_10940 ]

Bill Pierce commented on IOC-56:
--------------------------------

See:
http://groups.google.com/group/castle-project-devel/msg/9e2b4cc00b879116?hl=en&

Ayende is correct. The ultimate goal with this patch and with IOC 57 is to be able to configure a parent kernel with base/core functionality and to configure n-number of child kernels that can selectively override that functionality, including core functionality dependencies.

I was hoping this could tie into the scoped containers by having the parent kernel then having a child kernel per host header. Then an HTTP Handler could add the proper child kernel to the Request context and the rest would be transparent to the application.

Thoughts?

> Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
> ----------------------------------------------------------------------------------------------
>
> Key: IOC-56
> URL: http://support.castleproject.org//browse/IOC-56
> Project: MicroKernel-Windsor
> Issue Type: New Feature
> Components: MicroKernel
> Affects Versions: RC 4
> Reporter: Bill Pierce
> Priority: Minor
>
> I would like to see the following functionality:
> Create Parent Kernel
> Add Comonent X to parent Kernel. Component X has dependencies A and B
> Add Component A to parent Kernel.
> Create Child Kernel
> Add Component B to child Kernel.
> Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel
> Request Component X from parent kernel, receive component without dependency component B fulfullied.

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

--

Hamilton Verissimo

unread,
Jan 5, 2007, 10:50:46 AM1/5/07
to castle-pro...@googlegroups.com
On 1/5/07, Bill Pierce (JIRA) <jiranoti...@castleproject.org> wrote:
> See:
> http://groups.google.com/group/castle-project-devel/msg/9e2b4cc00b879116?hl=en&

Now it makes sense. I guess I didn't bump into this situation yet,
hence my initial skepticism, not to mention the misunderstanding.

I'll reopen the issue.

--
Cheers,
hamilton verissimo
ham...@castlestronghold.com
http://www.castlestronghold.com/

hamilton verissimo (JIRA)

unread,
Jan 5, 2007, 11:51:20 AM1/5/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=all ]

hamilton verissimo reopened IOC-56:
-----------------------------------

Assignee: hamilton verissimo

> Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
> ----------------------------------------------------------------------------------------------
>
> Key: IOC-56
> URL: http://support.castleproject.org//browse/IOC-56
> Project: MicroKernel-Windsor
> Issue Type: New Feature
> Components: MicroKernel
> Affects Versions: RC 4
> Reporter: Bill Pierce

> Assigned To: hamilton verissimo


> Priority: Minor
>
> I would like to see the following functionality:
> Create Parent Kernel
> Add Comonent X to parent Kernel. Component X has dependencies A and B
> Add Component A to parent Kernel.
> Create Child Kernel
> Add Component B to child Kernel.
> Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel
> Request Component X from parent kernel, receive component without dependency component B fulfullied.

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

--

hamilton verissimo (JIRA)

unread,
Feb 3, 2007, 4:18:33 PM2/3/07
to castle-pro...@googlegroups.com
[ http://support.castleproject.org//browse/IOC-56?page=all ]

hamilton verissimo resolved IOC-56.
-----------------------------------

Fix Version/s: RC 4
Resolution: Applied

Applied

> Use Child Components for Parent Dependencies When Requesting Parent Component via Child Kernel
> ----------------------------------------------------------------------------------------------
>
> Key: IOC-56
> URL: http://support.castleproject.org//browse/IOC-56
> Project: MicroKernel-Windsor
> Issue Type: New Feature
> Components: MicroKernel
> Affects Versions: RC 4
> Reporter: Bill Pierce

> Assigned To: hamilton verissimo
> Priority: Minor

> Fix For: RC 4


>
>
> I would like to see the following functionality:
> Create Parent Kernel
> Add Comonent X to parent Kernel. Component X has dependencies A and B
> Add Component A to parent Kernel.
> Create Child Kernel
> Add Component B to child Kernel.
> Request Component X from child kernel, receive component fully populated with dependency component B from Child kernel
> Request Component X from parent kernel, receive component without dependency component B fulfullied.

> I have a patch + unit tests for this, however, I have made other changes for other patches that haven't been added to the trunk quite yet. I'm not sure how to isolate changes between two patches.

--

Reply all
Reply to author
Forward
0 new messages