12h
awarded Yearling
15h
awarded Yearling
Jun
29
revised Passing Anonymous Type to a Bound Control
edited tags
Jun
28
comment Tricky architecture in C# involving a symmetric operation and a viewing class
I don't have time to give a full answer now... but if you're building an API for others to extend then using MEF might help. Your users could register their SymmetricalFoos using the ExportAttribute and the abstract factory would pick them up dynamically.
Jun
28
comment Tricky architecture in C# involving a symmetric operation and a viewing class
The abstract factory doesn't need to be a singleton. It just needs to know how to map the pair E,x to the appropriate SymmetricalFoo and how to construct it. The simplest way to implement that mapping is to hardcode it into the factory. Granted, it's not ideal. Every time you add a new I subclass you'll need to modify the factory... but that's still a whole lot better than having to modify all the existing I subclasses.
Jun
28
comment Tricky architecture in C# involving a symmetric operation and a viewing class
this is all very abstract. Maybe it'll be easier to talk about this in chat.
Jun
28
comment Tricky architecture in C# involving a symmetric operation and a viewing class
I was mentioning using an abstract factory in the context of my answer. In that answer I recommended moving the symmetrical Foo method into separate classes (one for each I subclass pair) and using the factory to resolve, at runtime, which of those classes to use. The advantage being that when you add new I subclasses you don't need to modify existing ones. And, if a developer creates a new I subclass but forgets to create all the other classes for each new I,I pair, then the factory will throw an exception at run time.
Jun
28
comment Tricky architecture in C# involving a symmetric operation and a viewing class
Although it can't easily be enforced at compile time, using an abstract factory (to resolve the appropriate method from the class pairings) would allow you to enforce it at run time.
Jun
28
revised Tricky architecture in C# involving a symmetric operation and a viewing class
added 2 characters in body
Jun
28
revised Tricky architecture in C# involving a symmetric operation and a viewing class
added 212 characters in body
Jun
28
comment Tricky architecture in C# involving a symmetric operation and a viewing class
Well, this is one of the few cases where an abstract factory would work. Create an abstract factory that takes as parameters two instances of I subclasses and returns the appropriate SymmetricalFoo. V would interact with that factory. I'll add this to the answer.
Jun
28
revised Tricky architecture in C# involving a symmetric operation and a viewing class
added 212 characters in body
Jun
28
answered Tricky architecture in C# involving a symmetric operation and a viewing class
Jun
27
reviewed Approve suggested edit on Single-responsibility and custom data types
Jun
27
reviewed Approve suggested edit on Reading file during write on linux
Jun
26
awarded Nice Answer
Jun
24
comment How do I use a list of int to set the index of another list
pseudo-code: for (i = 0; < index.length; i++) var blah = dictionary[index[i]] ?
Jun
23
awarded Popular Question
Jun
23
comment Modern Interpretation of the Unix Philosophy of "Rule of Generation"
I agree, it is ambiguous. But, I interpreted it as low-level code (eg, machine code, or even assembly).
Jun
23
comment Modern Interpretation of the Unix Philosophy of "Rule of Generation"
Isn't coding in Java an application of that rule?
1 2 3 4 5