158 reputation
18
bio website justin-pihony.blogspot.com
location Pittsburgh, PA, United States
age 31
visits member for 2 years, 9 months
seen Dec 12 at 18:36

I am an aspiring software craftsman, always looking for ways to better myself and more things to learn :)

By my most common question types being answered properly (upvotes/accepts), my current strengths are:

  • SQL
  • Async
  • REST
  • C# basics

My motto seems to be turning into KISS :)


Dec
6
awarded  Critic
Dec
6
accepted Should all public methods in an abstract class be marked virtual?
Aug
5
awarded  Nice Question
Sep
25
awarded  Notable Question
May
29
comment Should a repository be passed in to the User Interface
+1, but you and I are in total agreement :p. I will probably leave the question open for a week or so just to see if anybody has a compelling argument against us, though...to be safe :)
May
29
awarded  Editor
May
29
comment Should a repository be passed in to the User Interface
I updated my answer to have simplified, contrived for readability example.
May
29
revised Should a repository be passed in to the User Interface
added 610 characters in body
May
29
comment Should a repository be passed in to the User Interface
But, that would be if you had only two layers: UI and persistence. In the three tier architecture that is being used, the service is the only thing that cares about the persistence layer. In fact, the repository is only being pulled into the UI to pass into the service layer.
May
29
comment Should a repository be passed in to the User Interface
But, my point is that you are still exposing the persistence layer (however implemented) in the UI layer when you only need it in the service layer.
May
29
asked Should a repository be passed in to the User Interface
Jan
9
awarded  Popular Question
Apr
15
comment Should all public methods in an abstract class be marked virtual?
I would argue that, as long as the overall behavior remains the same, then this could be made virtual. You could fill the pre/post conditions using a different implementation (database vs in-memory). Otherwise, it should be a private function?
Apr
15
comment Should all public methods in an abstract class be marked virtual?
First I will go over your C# q's. An abstract method in C# is implicitly virtual and cannot have an implementation. As to your first point, an abstract class in C# can, and should have an implementation of some sort (otherwise you should just use an interface). The point of a class being abstract is that it MUST be subclassed, however it contains logic that (theoretically) all subclasses will use. This cuts down on code duplication. What I am asking is whether any of those implementations should be closed off from being overriden (essentially saying the base way is the only way).
Apr
15
asked Should all public methods in an abstract class be marked virtual?
Apr
15
comment Is Debug.Assert obsolete if you write unit tests?
@BenC Thanks for the link. I liked Berin's answer relating Design-By-Contract. That actually clicked the most with me..and made me wonder why I didn't see that in the first place :-p
Apr
15
awarded  Supporter
Apr
15
awarded  Scholar
Apr
15
accepted Is Debug.Assert obsolete if you write unit tests?
Apr
15
awarded  Student