2,677 reputation
718
bio website
location
age
visits member for 3 years, 3 months
seen 1 hour ago

Oct
17
comment How can I mock this architecture?
Seems to me that mock frameworks generally work because the class-that-is-to-be-laughed-at implements an interface and your code uses that-interface-type references. And I don't see why both key and value objects must be mocked. And if enums are essentially compile-time constants of integers then mocking it seems pointless (you really can't hurt an enums feelings). BUT in C# you can get away with casting an invalid value to that enum-type
Oct
14
awarded  Yearling
Sep
29
comment When should something be a class? And are my chosen classes good OO design?
I'm just making the point that there is nothing exotic about "dependency injection". Now code slinging an IOC... ooohh, I'm getting a buzz word buzz! Must. breath. slowly.
Sep
29
comment When should something be a class? And are my chosen classes good OO design?
The book Dependency Injection in .NET says, paraphrasing, "90% of dependency injection you will do will be passing parameters in a method, usually a constructor".
Sep
23
comment What are some good ways to monitor team mood?
Mood Rings and e-meters come to mind
Sep
8
comment Allow entities owned by one user to be referenced by other users' entities
We have some DB-level uniqueness constraints (in addition to the PKs and FKs) and we programmatically verify uniqueness of user entry. So you could do this on name & coordinate , in combination or not. In the UI maybe couple that to a ComboBox of existing EventAreas constrained geographically(?); and/or perhaps dynamically update the list as the user types. Our UI has a custom class - a textbox & popup fusion - the popup is practical for very long lists and is scrollable and filterable.
Sep
8
answered Allow entities owned by one user to be referenced by other users' entities
Aug
16
answered Can't understand on how to implement MVP/MVC for my software requirements
Aug
13
revised Which pattern is suitable to send multiple type of responses through REST web service?
added 5 characters in body
Aug
13
revised Which pattern is suitable to send multiple type of responses through REST web service?
added 284 characters in body
Aug
13
answered Which pattern is suitable to send multiple type of responses through REST web service?
Aug
11
comment Should an abstract class always abstract its methods to an interface?
+1 @Travis comment-link. "abstract classes should always abstract their functions to an interface". By Grapthar's hammer, this shall not pass! It's object oriented Jim, but not as we (should) know it. Resistance is not futile!
Aug
11
comment Inheriting from Abstract class vs Enum Types for custom exceptions
"Inherit from Abstract Class" but we're discussing interface, i.e. the C# keyword yes? So why not a templated abstract class? The virtual methods are called within the abstract "code framework" and give the Director context for knowing what exception to throw. You may have to design a ReturnResult class so the communication is rich enough to make intelligent decisions; that is to say, object oriented. This does not have to conflict with @Magus comment, that I up-voted.
Aug
10
comment Assigning responsibility for cancelling an Order
@cbojar; "OrderProcessor" - fully agree. As for "god object", that was not meant to be technically accurate.
Aug
10
answered Assigning responsibility for cancelling an Order
Aug
7
answered Extending a struct. Using helper classes rather than composition
Aug
7
comment How do you make a service stateless?
@Songo, the goal is to not have any class variables holding onto any objects. But it's being returned and can't set it to null. We could have used ref parameters if we felt that was an issue to resolve.
Aug
6
answered How do you make a service stateless?
Aug
2
comment Why does C# allow properties in interfaces?
+1 Properties are methods! yes! I like writing Propertymethods but code-reviewing co-workers don't see it that way and we really miss opportunities for some nice expressive encapsulations in our programs.
Jul
30
comment What is meant by “OOP hides the state”?
Alan Kay said if you're changing state directly, i.e. exposing properties, you're doing it [OO programming] wrong. Ditto. How many times have a thought, "how was it I was supposed to know to set these properties before I called that method? Thank goodness for copy and paste!"