Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
by all i mean explicit vs implicit: - Kernel.Register(Component.ForIEnumerableint().Instance(new[] { 1 })); - Kernel.Register(Classes.From(typeof(int[])).Pick().WithServiceAllInterfaces()); On Thursday, July 12, 2012 1:59:39 AM UTC-4, Krzysztof Koźmic wrote: what do you mean by which affects all forms of registration. ? @K bling wrote: GetEnumerator() is a method :P, badly forced example aside, after digging through the code i see that the exception thrown is checking specifically that something is registered as IEnumerableValueType, which affects all forms of registration. anywho, you don't need to revert the change. i can exclude anything that implements IEnumerableValueType. however, i'd also like to hear other opinions. thanks, bling On Thursday, July 12, 2012 1:16:28 AM UTC-4, Krzysztof Koźmic wrote: Well that's the thing. I'm not sure it's reasonable. If you want to provide prices you'd expose that via a method, not on the type itself. And that's the reason for this change in the first place - value type or collection of value type as a service is not a real service and it should never have been supported. Since v3.1 is a minor update I guess I'm willing to revert that behavior and keep it the old way in this case, while postponing the change to the next major version. But in the long run, clearly you're registering a service that is not meant to be a service, and is probably never used as such anyway. What do other folks think of that? @K bling wrote: IMO, i think the whole point of having scanning is to avoid being explicit. if i need to use WithService.Select, which is not much more useful then registering everything explicitly, to get around the new semantics of WithAllInterfaces, then its usefulness has decreased substantially. aside, if a user wants to register IEnumerableValueType into Windsor, which worked before (and presumably every version prior to 3.1), why was it changed to not support it? it's easy to come up with a reasonable use case, like a service which provides real time stock prices in the form of value types, exposed as IEnumerableStockPrice. thx, bling On Wednesday, July 11, 2012 10:11:47 PM UTC-4, Krzysztof Koźmic wrote: I'm not sure I want to ignore anything. If a user wants to register something they should either get it registered or should be notified it's not supported. After giving it some more thoughts I'm thinking perhaps we should leave the current behavior. If having IEnumerableSomething is not your intention be explicit about it and do not include it. The idea with system interfaces is more complicated than it seems. In reality all Microsoft interfaces are in System.something namespace so having a blanket arbitrary rule to filter them out built into Windsor doesn't look like such a good idea after all. I think the solution I would advise and the one I'm leaning towards most is to leave the behavior and API exactly as it is now, and just recommend people to use WithiService.Select(be specific here) instead. @K bling wrote: correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
...none of which is valid In other words, that's by design. @K bling wrote: by all i mean explicit vs implicit: - Kernel.Register(Component.ForIEnumerableint().Instance(new[] { 1 })); - Kernel.Register(Classes.From(typeof(int[])).Pick().WithServiceAllInterfaces()); On Thursday, July 12, 2012 1:59:39 AM UTC-4, Krzysztof Koźmic wrote: what do you mean by which affects all forms of registration. ? @K bling wrote: GetEnumerator() is a method :P, badly forced example aside, after digging through the code i see that the exception thrown is checking specifically that something is registered as IEnumerableValueType, which affects all forms of registration. anywho, you don't need to revert the change. i can exclude anything that implements IEnumerableValueType. however, i'd also like to hear other opinions. thanks, bling On Thursday, July 12, 2012 1:16:28 AM UTC-4, Krzysztof Koźmic wrote: Well that's the thing. I'm not sure it's reasonable. If you want to provide prices you'd expose that via a method, not on the type itself. And that's the reason for this change in the first place - value type or collection of value type as a service is not a real service and it should never have been supported. Since v3.1 is a minor update I guess I'm willing to revert that behavior and keep it the old way in this case, while postponing the change to the next major version. But in the long run, clearly you're registering a service that is not meant to be a service, and is probably never used as such anyway. What do other folks think of that? @K bling wrote: IMO, i think the whole point of having scanning is to avoid being explicit. if i need to use WithService.Select, which is not much more useful then registering everything explicitly, to get around the new semantics of WithAllInterfaces, then its usefulness has decreased substantially. aside, if a user wants to register IEnumerableValueType into Windsor, which worked before (and presumably every version prior to 3.1), why was it changed to not support it? it's easy to come up with a reasonable use case, like a service which provides real time stock prices in the form of value types, exposed as IEnumerableStockPrice. thx, bling On Wednesday, July 11, 2012 10:11:47 PM UTC-4, Krzysztof Koźmic wrote: I'm not sure I want to ignore anything. If a user wants to register something they should either get it registered or should be notified it's not supported. After giving it some more thoughts I'm thinking perhaps we should leave the current behavior. If having IEnumerableSomething is not your intention be explicit about it and do not include it. The idea with system interfaces is more complicated than it seems. In reality all Microsoft interfaces are in System.something namespace so having a blanket arbitrary rule to filter them out built into Windsor doesn't look like such a good idea after all. I think the solution I would advise and the one I'm leaning towards most is to leave the behavior and API exactly as it is now, and just recommend people to use WithiService.Select(be specific here) instead. @K bling wrote: correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
fair enough @K bling wrote: i'm not suggesting that it's a good idea to do this. i just don't think the container should impose /technical/ restrictions on its use. On Thursday, July 12, 2012 2:03:19 AM UTC-4, Krzysztof Koźmic wrote: ...none of which is valid In other words, that's by design. @K bling wrote: by all i mean explicit vs implicit: - Kernel.Register(Component.ForIEnumerableint().Instance(new[] { 1 })); - Kernel.Register(Classes.From(typeof(int[])).Pick().WithServiceAllInterfaces()); On Thursday, July 12, 2012 1:59:39 AM UTC-4, Krzysztof Koźmic wrote: what do you mean by which affects all forms of registration. ? @K bling wrote: GetEnumerator() is a method :P, badly forced example aside, after digging through the code i see that the exception thrown is checking specifically that something is registered as IEnumerableValueType, which affects all forms of registration. anywho, you don't need to revert the change. i can exclude anything that implements IEnumerableValueType. however, i'd also like to hear other opinions. thanks, bling On Thursday, July 12, 2012 1:16:28 AM UTC-4, Krzysztof Koźmic wrote: Well that's the thing. I'm not sure it's reasonable. If you want to provide prices you'd expose that via a method, not on the type itself. And that's the reason for this change in the first place - value type or collection of value type as a service is not a real service and it should never have been supported. Since v3.1 is a minor update I guess I'm willing to revert that behavior and keep it the old way in this case, while postponing the change to the next major version. But in the long run, clearly you're registering a service that is not meant to be a service, and is probably never used as such anyway. What do other folks think of that? @K bling wrote: IMO, i think the whole point of having scanning is to avoid being explicit. if i need to use WithService.Select, which is not much more useful then registering everything explicitly, to get around the new semantics of WithAllInterfaces, then its usefulness has decreased substantially. aside, if a user wants to register IEnumerableValueType into Windsor, which worked before (and presumably every version prior to 3.1), why was it changed to not support it? it's easy to come up with a reasonable use case, like a service which provides real time stock prices in the form of value types, exposed as IEnumerableStockPrice. thx, bling On Wednesday, July 11, 2012 10:11:47 PM UTC-4, Krzysztof Koźmic wrote: I'm not sure I want to ignore anything. If a user wants to register something they should either get it registered or should be notified it's not supported. After giving it some more thoughts I'm thinking perhaps we should leave the current behavior. If having IEnumerableSomething is not your intention be explicit about it and do not include it. The idea with system interfaces is more complicated than it seems. In reality all Microsoft interfaces are in System.something namespace so having a blanket arbitrary rule to filter them out built into Windsor doesn't look like such a good idea after all. I think the solution I would advise and the one I'm leaning towards most is to leave the behavior and API exactly as it is now, and just recommend people to use WithiService.Select(be specific here) instead. @K bling wrote: correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/XoHKFmgRYXYJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
I'm not sure I want to ignore anything. If a user wants to register something they should either get it registered or should be notified it's not supported. After giving it some more thoughts I'm thinking perhaps we should leave the current behavior. If having IEnumerableSomething is not your intention be explicit about it and do not include it. The idea with system interfaces is more complicated than it seems. In reality all Microsoft interfaces are in System.something namespace so having a blanket arbitrary rule to filter them out built into Windsor doesn't look like such a good idea after all. I think the solution I would advise and the one I'm leaning towards most is to leave the behavior and API exactly as it is now, and just recommend people to use WithiService.Select(be specific here) instead. @K bling wrote: correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
IMO, i think the whole point of having scanning is to avoid being explicit. if i need to use WithService.Select, which is not much more useful then registering everything explicitly, to get around the new semantics of WithAllInterfaces, then its usefulness has decreased substantially. aside, if a user wants to register IEnumerableValueType into Windsor, which worked before (and presumably every version prior to 3.1), why was it changed to not support it? it's easy to come up with a reasonable use case, like a service which provides real time stock prices in the form of value types, exposed as IEnumerableStockPrice. thx, bling On Wednesday, July 11, 2012 10:11:47 PM UTC-4, Krzysztof Koźmic wrote: I'm not sure I want to ignore anything. If a user wants to register something they should either get it registered or should be notified it's not supported. After giving it some more thoughts I'm thinking perhaps we should leave the current behavior. If having IEnumerableSomething is not your intention be explicit about it and do not include it. The idea with system interfaces is more complicated than it seems. In reality all Microsoft interfaces are in System.something namespace so having a blanket arbitrary rule to filter them out built into Windsor doesn't look like such a good idea after all. I think the solution I would advise and the one I'm leaning towards most is to leave the behavior and API exactly as it is now, and just recommend people to use WithiService.Select(be specific here) instead. @K bling wrote: correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/kJsk4S5RkAoJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
GetEnumerator() is a method :P, badly forced example aside, after digging through the code i see that the exception thrown is checking specifically that something is registered as IEnumerableValueType, which affects all forms of registration. anywho, you don't need to revert the change. i can exclude anything that implements IEnumerableValueType. however, i'd also like to hear other opinions. thanks, bling On Thursday, July 12, 2012 1:16:28 AM UTC-4, Krzysztof Koźmic wrote: Well that's the thing. I'm not sure it's reasonable. If you want to provide prices you'd expose that via a method, not on the type itself. And that's the reason for this change in the first place - value type or collection of value type as a service is not a real service and it should never have been supported. Since v3.1 is a minor update I guess I'm willing to revert that behavior and keep it the old way in this case, while postponing the change to the next major version. But in the long run, clearly you're registering a service that is not meant to be a service, and is probably never used as such anyway. What do other folks think of that? @K bling wrote: IMO, i think the whole point of having scanning is to avoid being explicit. if i need to use WithService.Select, which is not much more useful then registering everything explicitly, to get around the new semantics of WithAllInterfaces, then its usefulness has decreased substantially. aside, if a user wants to register IEnumerableValueType into Windsor, which worked before (and presumably every version prior to 3.1), why was it changed to not support it? it's easy to come up with a reasonable use case, like a service which provides real time stock prices in the form of value types, exposed as IEnumerableStockPrice. thx, bling On Wednesday, July 11, 2012 10:11:47 PM UTC-4, Krzysztof Koźmic wrote: I'm not sure I want to ignore anything. If a user wants to register something they should either get it registered or should be notified it's not supported. After giving it some more thoughts I'm thinking perhaps we should leave the current behavior. If having IEnumerableSomething is not your intention be explicit about it and do not include it. The idea with system interfaces is more complicated than it seems. In reality all Microsoft interfaces are in System.something namespace so having a blanket arbitrary rule to filter them out built into Windsor doesn't look like such a good idea after all. I think the solution I would advise and the one I'm leaning towards most is to leave the behavior and API exactly as it is now, and just recommend people to use WithiService.Select(be specific here) instead. @K bling wrote: correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ. To post to this group, send email to castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com mailto:castle-project-users%2bunsubscr...@googlegroups.com. For more options, visit this group at
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
what do you mean by which affects all forms of registration. ? @K bling wrote: GetEnumerator() is a method :P, badly forced example aside, after digging through the code i see that the exception thrown is checking specifically that something is registered as IEnumerableValueType, which affects all forms of registration. anywho, you don't need to revert the change. i can exclude anything that implements IEnumerableValueType. however, i'd also like to hear other opinions. thanks, bling On Thursday, July 12, 2012 1:16:28 AM UTC-4, Krzysztof Koźmic wrote: Well that's the thing. I'm not sure it's reasonable. If you want to provide prices you'd expose that via a method, not on the type itself. And that's the reason for this change in the first place - value type or collection of value type as a service is not a real service and it should never have been supported. Since v3.1 is a minor update I guess I'm willing to revert that behavior and keep it the old way in this case, while postponing the change to the next major version. But in the long run, clearly you're registering a service that is not meant to be a service, and is probably never used as such anyway. What do other folks think of that? @K bling wrote: IMO, i think the whole point of having scanning is to avoid being explicit. if i need to use WithService.Select, which is not much more useful then registering everything explicitly, to get around the new semantics of WithAllInterfaces, then its usefulness has decreased substantially. aside, if a user wants to register IEnumerableValueType into Windsor, which worked before (and presumably every version prior to 3.1), why was it changed to not support it? it's easy to come up with a reasonable use case, like a service which provides real time stock prices in the form of value types, exposed as IEnumerableStockPrice. thx, bling On Wednesday, July 11, 2012 10:11:47 PM UTC-4, Krzysztof Koźmic wrote: I'm not sure I want to ignore anything. If a user wants to register something they should either get it registered or should be notified it's not supported. After giving it some more thoughts I'm thinking perhaps we should leave the current behavior. If having IEnumerableSomething is not your intention be explicit about it and do not include it. The idea with system interfaces is more complicated than it seems. In reality all Microsoft interfaces are in System.something namespace so having a blanket arbitrary rule to filter them out built into Windsor doesn't look like such a good idea after all. I think the solution I would advise and the one I'm leaning towards most is to leave the behavior and API exactly as it is now, and just recommend people to use WithiService.Select(be specific here) instead. @K bling wrote: correction: ...since i would *not* expect that to throw... On Wednesday, July 11, 2012 9:42:25 AM UTC-4, bling wrote: that would work. however, i'm more questioning in the intent of the scanning registration API, since i would expect that to throw any kind of exception. worst case should be that you don't have something registered. if that can still be the case, then you can simply ignore IEnumerableValueType instead of throwing. if that won't fly, you could also do a WithServiceAllInterfaces(bool excludeSystemInterfaces = true) thx! p.s. i've logged the bug at http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347 http://issues.castleproject.org/issue/IOC-347, although if you add a new WithService* then it'd be more of a feature request. On Tuesday, July 10, 2012 6:09:48 PM UTC-4, bling wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ https://groups.google.com/d/msg/castle-project-users/-/eTbUtzwyAZMJ. To post to this group, send email to castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com. To unsubscribe from this group, send email to
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
Thanks. Can you create an actual failing test? Thanks @k On Jul 11, 2012 8:09 AM, bling bailey.l...@gmail.com wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J. To post to this group, send email to castle-project-users@googlegroups.com . To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
[Test] public void RegisterGenericType_WithServiceAllInterfaces() { Assert.DoesNotThrow(() = Kernel.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceAllInterfaces())); } On Tuesday, July 10, 2012 6:10:57 PM UTC-4, Krzysztof Koźmic wrote: Thanks. Can you create an actual failing test? Thanks @k On Jul 11, 2012 8:09 AM, bling bailey.l...@gmail.com wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/f2QKPH2AibYJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
Thanks, I've got it reproduced. Do you mind logging this as a bug in the issue tracker at issues.castleproject.org ? cheers, @K On 11/07/12 8:28 AM, bling wrote: [Test] public void RegisterGenericType_WithServiceAllInterfaces() { Assert.DoesNotThrow(() = Kernel.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceAllInterfaces())); } On Tuesday, July 10, 2012 6:10:57 PM UTC-4, Krzysztof Koźmic wrote: Thanks. Can you create an actual failing test? Thanks @k On Jul 11, 2012 8:09 AM, bling bailey.l...@gmail.com mailto:bailey.l...@gmail.com wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J. To post to this group, send email to castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com mailto:castle-project-users%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/f2QKPH2AibYJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
So leaving this example aside, the reason for this behavior is that Windsor sees you're registering your type as IEnumerableSomeValueType which while used to be allowed previously is not really something you'd want to have as a service. So can you help me better understand in your actual scenario why do you want to expose IEnumerableSomeValueType as a service off your component? thanks, @K On 11/07/12 8:28 AM, bling wrote: [Test] public void RegisterGenericType_WithServiceAllInterfaces() { Assert.DoesNotThrow(() = Kernel.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceAllInterfaces())); } On Tuesday, July 10, 2012 6:10:57 PM UTC-4, Krzysztof Koźmic wrote: Thanks. Can you create an actual failing test? Thanks @k On Jul 11, 2012 8:09 AM, bling bailey.l...@gmail.com mailto:bailey.l...@gmail.com wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J. To post to this group, send email to castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com mailto:castle-project-users%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/f2QKPH2AibYJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
I don't. The way I have my application is the typical: - Register explicitly, i.e. Component.ForIFoo().ImplementedByFoo()..., for things that I need explicit. - Then, some convention based things. Like Classes.Pick().BasedOnBar().WithServiceBase(). - Finally, the catch all, which is Register(Classes.Pick().WithServiceSelf().WithServiceAllInterfaces()). I have an infrastructure library which contains a bunch of helper classes, some of which contain basic services that are required. As the infrastructure library, it also will contain things that are not services, like a ReadOnlyDictionary,, which is what caused the exception. WithDefaultInterfaces() will not work since some classes are not a 1-to-1 implementation, and implement multiple service interfaces. On Tuesday, July 10, 2012 10:39:07 PM UTC-4, Krzysztof Koźmic wrote: So leaving this example aside, the reason for this behavior is that Windsor sees you're registering your type as IEnumerableSomeValueType which while used to be allowed previously is not really something you'd want to have as a service. So can you help me better understand in your actual scenario why do you want to expose IEnumerableSomeValueType as a service off your component? thanks, @K On 11/07/12 8:28 AM, bling wrote: [Test] public void RegisterGenericType_WithServiceAllInterfaces() { Assert.DoesNotThrow(() = Kernel.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceAllInterfaces())); } On Tuesday, July 10, 2012 6:10:57 PM UTC-4, Krzysztof Koźmic wrote: Thanks. Can you create an actual failing test? Thanks @k On Jul 11, 2012 8:09 AM, bling bailey.l...@gmail.com wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/f2QKPH2AibYJ. To post to this group, send email to castle-project-users@googlegroups.com . To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/mSI1F8MzbNUJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
Yep, pretty much. On Tuesday, July 10, 2012 11:56:18 PM UTC-4, Krzysztof Koźmic wrote: Right, so what you really want is not All interfaces but rather service interfaces that would be like all interfaces but filtering out noise that is all the ISerializable, IDisposable, IComparable, IEnumerableValueType etc? @K On 11/07/12 12:57 PM, bling wrote: I don't. The way I have my application is the typical: - Register explicitly, i.e. Component.ForIFoo().ImplementedByFoo()..., for things that I need explicit. - Then, some convention based things. Like Classes.Pick().BasedOnBar().WithServiceBase(). - Finally, the catch all, which is Register(Classes.Pick().WithServiceSelf().WithServiceAllInterfaces()). I have an infrastructure library which contains a bunch of helper classes, some of which contain basic services that are required. As the infrastructure library, it also will contain things that are not services, like a ReadOnlyDictionary,, which is what caused the exception. WithDefaultInterfaces() will not work since some classes are not a 1-to-1 implementation, and implement multiple service interfaces. On Tuesday, July 10, 2012 10:39:07 PM UTC-4, Krzysztof Koźmic wrote: So leaving this example aside, the reason for this behavior is that Windsor sees you're registering your type as IEnumerableSomeValueType which while used to be allowed previously is not really something you'd want to have as a service. So can you help me better understand in your actual scenario why do you want to expose IEnumerableSomeValueType as a service off your component? thanks, @K On 11/07/12 8:28 AM, bling wrote: [Test] public void RegisterGenericType_WithServiceAllInterfaces() { Assert.DoesNotThrow(() = Kernel.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceAllInterfaces())); } On Tuesday, July 10, 2012 6:10:57 PM UTC-4, Krzysztof Koźmic wrote: Thanks. Can you create an actual failing test? Thanks @k On Jul 11, 2012 8:09 AM, bling bailey.l...@gmail.com wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/f2QKPH2AibYJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/mSI1F8MzbNUJ. To post to this group, send email to castle-project-users@googlegroups.com . To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/QnXe6-2WasIJ. To post to this group, send email to castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Re: Windsor 3.1 RC, regression with WithServiceAllInterfaces
Ok, so what do you say on adding a method that behaves like AllInterfaces but filters out all interfaces that are in System namespaces (or one of its subnamespaces)? I'm just not sure what would be a good name for the method in the API... WithService.NonSystemInterfaces() just doesn't sound cool :) Ideas anyone? @K bling wrote: Yep, pretty much. On Tuesday, July 10, 2012 11:56:18 PM UTC-4, Krzysztof Koźmic wrote: Right, so what you really want is not All interfaces but rather service interfaces that would be like all interfaces but filtering out noise that is all the ISerializable, IDisposable, IComparable, IEnumerableValueType etc? @K On 11/07/12 12:57 PM, bling wrote: I don't. The way I have my application is the typical: * Register explicitly, i.e. Component.ForIFoo().ImplementedByFoo()..., for things that I need explicit. * Then, some convention based things. Like Classes.Pick().BasedOnBar().WithServiceBase(). * Finally, the catch all, which is Register(Classes.Pick().WithServiceSelf().WithServiceAllInterfaces()). I have an infrastructure library which contains a bunch of helper classes, some of which contain basic services that are required. As the infrastructure library, it also will contain things that are not services, like a ReadOnlyDictionary,, which is what caused the exception. WithDefaultInterfaces() will not work since some classes are not a 1-to-1 implementation, and implement multiple service interfaces. On Tuesday, July 10, 2012 10:39:07 PM UTC-4, Krzysztof Koźmic wrote: So leaving this example aside, the reason for this behavior is that Windsor sees you're registering your type as IEnumerableSomeValueType which while used to be allowed previously is not really something you'd want to have as a service. So can you help me better understand in your actual scenario why do you want to expose IEnumerableSomeValueType as a service off your component? thanks, @K On 11/07/12 8:28 AM, bling wrote: [Test] public void RegisterGenericType_WithServiceAllInterfaces() { Assert.DoesNotThrow(() = Kernel.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceAllInterfaces())); } On Tuesday, July 10, 2012 6:10:57 PM UTC-4, Krzysztof Koźmic wrote: Thanks. Can you create an actual failing test? Thanks @k On Jul 11, 2012 8:09 AM, bling bailey.l...@gmail.com mailto:bailey.l...@gmail.com wrote: the following works with 3.0, but throws an exception in 3.1 var c = new WindsorContainer(); c.Register(Classes.From(typeof(Dictionary,)).Pick().WithServiceBase().WithServiceAllInterfaces()); i'm not sure what the actual issue is, but exception message complained about ICollectionKeyValuePair, so i took a guess and was able to reproduce. a class similar to that signature does exist in my actual code. thanks, bling -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J https://groups.google.com/d/msg/castle-project-users/-/M4VIrLskVH8J. To post to this group, send email to castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com mailto:castle-project-users%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/f2QKPH2AibYJ https://groups.google.com/d/msg/castle-project-users/-/f2QKPH2AibYJ. To post to this group, send email to castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com mailto:castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/mSI1F8MzbNUJ https://groups.google.com/d/msg/castle-project-users/-/mSI1F8MzbNUJ. To post to this group, send email to castle-project-users@googlegroups.com mailto:castle-project-users@googlegroups.com. To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com mailto:castle-project-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are