Reputation
329
Top tag
Next privilege 500 Rep.
Access review queues
Badges
1 9
Newest
 Curious
Impact
~4k people reached

  • 0 posts edited
  • 0 helpful flags
  • 30 votes cast
Jul
30
comment Is this a valid situation for returning rather than throwing an exception?
Otherwise I like your suggestion of using a wrapper class for legacy compatibility ;)
Jul
30
comment Is this a valid situation for returning rather than throwing an exception?
The problem is that both applications want those exceptions to be caught and handled: in both cases we still want that Dictionary<int,bool> result returned if an exception was thrown, its just that the second application wants to know for sure if an exception was thrown and what it was so it can report that the action it is taking is based on a calculation in which errors were encountered and so the action should be reviewed. The first application doesn't report errors specifically, just whatever happens to come back in the message string.
Jul
30
comment Is this a valid situation for returning rather than throwing an exception?
That's my thinking: why build another object for returning errors when an exception object will already be packed with information. As with all of these things though, there is usually a dark side to not using things the way they were intended...I just don't see it yet!
Jul
30
comment Is this a valid situation for returning rather than throwing an exception?
If a person gets allocated into buckets 1 and 3, then an exception was thrown before they could potentially get allocated into other buckets by the Calculate method, the legacy application does not care. The new application also doesn't care and will still use the half determined result, but does want to report that a distinct error happened: hence passing back the exception object to indicate something did go wrong..
Jul
30
comment Is this a valid situation for returning rather than throwing an exception?
We have control over all of the code, so breaking the interface is fine...it is simple enough to refactor this: the legacy application can simply ignore the new out Exception parameter passing a null Exception variable but not use it. Breaking the behaviour is not acceptable. The legacy application does not expect that an exception will ever be thrown from the Calculate method and isn't interested in exceptions that are thrown and caught in there.
Jul
30
comment Is this a valid situation for returning rather than throwing an exception?
The problem is that merely logging the exception does not communicate the error back to the calling code. In fact in this shared code I cant use a logging framework as the two applications use different frameworks.
Jul
30
asked Is this a valid situation for returning rather than throwing an exception?
Mar
20
awarded  Curious
Sep
5
asked Is DDD not appropriate for my website or should I introduce a Query Layer?
Sep
3
comment Ninject/DI: How to correctly pass initialisation data to injected type at runtime
Don't know how I missed that tutorial...this post and that article has brought me to the "ah-ha" moment. Thanks.
Sep
3
accepted Ninject/DI: How to correctly pass initialisation data to injected type at runtime
Aug
20
accepted Should I use the repository in the Domain Object or push the Domain Object back to the Service Layer?
Aug
20
comment Should I use the repository in the Domain Object or push the Domain Object back to the Service Layer?
Very helpful, practical and informative answer. Marking as the answer. Thanks!
Aug
20
asked Ninject/DI: How to correctly pass initialisation data to injected type at runtime
Jul
22
comment Should I use the repository in the Domain Object or push the Domain Object back to the Service Layer?
My domain objects are not the Entities, so adding them to the Licenses collection, which is just a List will not cut it. The question is not so much about EF though as it is where the actual persistence takes places. All persistence in EF must take place within a context scope. The question is where does this belong?
Jul
22
asked Should I use the repository in the Domain Object or push the Domain Object back to the Service Layer?
Jun
18
answered How to transition from “help vampire” to “developer”?
Jun
4
awarded  Yearling
Jun
4
awarded  Teacher
Jun
4
answered Is ASP.NET MVC too much overhead for smaller projects?