Smurf Naming Convention
When almost every class has the same prefix. IE, when a user clicks on the button, a
SmurfAccountView
passes aSmurfAccountDTO
to theSmurfAccountController
. TheSmurfID
is used to fetch aSmurfOrderHistory
which is passed to theSmurfHistoryMatc
h before forwarding to eitherSmurfHistoryReviewView
orSmurfHistoryReportingView
. If aSmurfErrorEvent
occurs it is logged bySmurfErrorLogger
to${app}/smurf/log/smurf/smurflog.log
Smurf Naming Convention
When almost every class has the same prefix. IE, when a user clicks on the button, a
SmurfAccountView
passes aSmurfAccountDTO
to theSmurfAccountController
. TheSmurfID
is used to fetch aSmurfOrderHistory
which is passed to theSmurfHistoryMatc
h before forwarding to eitherSmurfHistoryReviewView
orSmurfHistoryReportingView
. If aSmurfErrorEvent
occurs it is logged bySmurfErrorLogger
to${app}/smurf/log/smurf/smurflog.log
Smurf Naming Convention
When almost every class has the same prefix. IE, when a user clicks on the button, a
SmurfAccountView
passes aSmurfAccountDTO
to theSmurfAccountController
. TheSmurfID
is used to fetch aSmurfOrderHistory
which is passed to theSmurfHistoryMatc
h before forwarding to eitherSmurfHistoryReviewView
orSmurfHistoryReportingView
. If aSmurfErrorEvent
occurs it is logged bySmurfErrorLogger
to${app}/smurf/log/smurf/smurflog.log
(If you used Java, you could use an enum - Java enums are more powerful than their C# counterpart, see http://stackoverflow.com/questions/469287/c-sharp-vs-java-enum-for-those-new-to-c https://stackoverflow.com/questions/469287/c-sharp-vs-java-enum-for-those-new-to-c - but we can emulate it in C# with multiton pattern).
(If you used Java, you could use an enum - Java enums are more powerful than their C# counterpart, see http://stackoverflow.com/questions/469287/c-sharp-vs-java-enum-for-those-new-to-c - but we can emulate it in C# with multiton pattern).
(If you used Java, you could use an enum - Java enums are more powerful than their C# counterpart, see https://stackoverflow.com/questions/469287/c-sharp-vs-java-enum-for-those-new-to-c - but we can emulate it in C# with multiton pattern).
Here's how I would approachtackle it, thinking out loud - obviously there isn't one right (or wrong) solution, II'll just wanttry to suggest a waysort of thinking about it by thinking out loudpitch my OOD approach to you.
I would move randomization of pieces into another class - let's call it PieceProvider
. Objects galore, but, well, that's consistent with Single Responsibility Principle. What if one day you wanted to adjust probabilities for different shapes? You shouldn't have to meddle with the implementation of the TetrisPiece
itself.
What if you wanted these probabilities different for various difficulty levels, for instance? Would you then supply the TetrisPiece
constructor with yet another parameter? ItThat's an increasingly clever piece we have, whereas it would be much simplier to just switch between different PieceProvider
s.
Here's how I would approach it - obviously there isn't one right (or wrong) solution, I just want to suggest a way of thinking about it by thinking out loud.
I would move randomization of pieces into another class - let's call it PieceProvider
. Objects galore, but, well, that's consistent with Single Responsibility Principle. What if one day you wanted to adjust probabilities for different shapes? You shouldn't have to meddle with the implementation of the TetrisPiece
itself.
What if you wanted these probabilities different for various difficulty levels, for instance? Would you then supply the TetrisPiece
constructor with yet another parameter? It would be much simplier to just switch between different PieceProvider
s.
Here's how I would tackle it, thinking out loud - obviously there isn't one right (or wrong) solution, I'll just try to sort of pitch my OOD approach to you.
I would move randomization of pieces into another class - let's call it PieceProvider
. Objects galore, but, well, that's consistent with Single Responsibility Principle. What if one day you wanted to adjust probabilities for different shapes? You shouldn't have to meddle with the implementation of the TetrisPiece
itself. What if you wanted these probabilities different for various difficulty levels, for instance? Would you then supply the TetrisPiece
constructor with yet another parameter? That's an increasingly clever piece we have, whereas it would be much simplier to just switch between different PieceProvider
s.