154 reputation
4
bio website adventuresindevelopment.blogs…
location Cape Town, South Africa
age 33
visits member for 2 years, 8 months
seen Apr 13 at 13:38

.NET gun for hire


Jan
18
revised What is the best way to access multiple child properties?
deleted 4 characters in body
Jan
18
comment What is the best way to access multiple child properties?
Mad generic skillz. Pretty cool. Thanks for the answer.
Jan
18
comment What is the best way to access multiple child properties?
@Morawski I am working on a service and our lead architect is exposing a set of persistent data/objects through an "Equipment" property. So you could have: if (Equipment.Ipc.IsOpen()) { Equipment.Ipc.InjectMessage(...); }. It just seems very repetitive. At the moment I create a reference to these frequently used items (such as Ipc) in my own class. It's ok, but I was wondering if there wasn't some design pattern that has an elegant way of dealing with such cases.
Jan
18
comment What is the best way to access multiple child properties?
@svick In my case I have to do this frequently, so my entire class is littered with these chains. It get's real ugly when you have to use those calls in statements : for(int i = 0; i < myAClass.BClass.CClass.Count(); i++) { ... }. Ok perhaps not the best example, but it becomes a lot less readable once you have loads of these.
Jan
18
comment What is the best way to access multiple child properties?
Great answer. Thanks!
Jan
18
asked What is the best way to access multiple child properties?
Dec
14
awarded  Editor
Dec
3
awarded  Student
Dec
1
comment Rapid code analysis
I must've been living under a rock. This is awesome! Thanks.
Nov
30
comment Rapid code analysis
@Alex Good advice. Thanks!
Nov
30
asked Rapid code analysis
Oct
19
awarded  Supporter
Oct
17
awarded  Autobiographer