Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

Smurf Naming Convention

When almost every class has the same prefix. IE, when a user clicks on the button, a SmurfAccountView passes a SmurfAccountDTO to the SmurfAccountController. The SmurfID is used to fetch a SmurfOrderHistory which is passed to the SmurfHistoryMatch before forwarding to either SmurfHistoryReviewView or SmurfHistoryReportingView. If a SmurfErrorEvent occurs it is logged by SmurfErrorLogger 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 a SmurfAccountDTO to the SmurfAccountController. The SmurfID is used to fetch a SmurfOrderHistory which is passed to the SmurfHistoryMatch before forwarding to either SmurfHistoryReviewView or SmurfHistoryReportingView. If a SmurfErrorEvent occurs it is logged by SmurfErrorLogger 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 a SmurfAccountDTO to the SmurfAccountController. The SmurfID is used to fetch a SmurfOrderHistory which is passed to the SmurfHistoryMatch before forwarding to either SmurfHistoryReviewView or SmurfHistoryReportingView. If a SmurfErrorEvent occurs it is logged by SmurfErrorLogger to ${app}/smurf/log/smurf/smurflog.log

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

(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).

deleted 1 character in body
Source Link

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 PieceProviders.

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 PieceProviders.

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 PieceProviders.

Source Link
Loading
lang-cs

AltStyle によって変換されたページ (->オリジナル) /