This post originated from an RSS feed registered with .NET Buzz
by Raymond Lewallen.
Original Post: Refactoring pattern quiz number 1
Feed Title: Raymond Lewallen
Feed URL: /error.htm?aspxerrorpath=/blogs/raymond.lewallen/rss.aspx
Feed Description: Patterns and Practices, OOP, .Net and Sql
Here is a pattern I'm sure we all see quite a bit. Nothing wrong
with it really. Small, clean, simple. However, when you take into
context the fact that the following code is part of an entire program
used to manage carnival rides, how would you refactor the following
code? No need to post code, an explanation will do. I'll post the
answer and the code in a little while.
Part of a carnival program
PublicClass Foo
Private baseTokenAmount As Int32 = 1
PublicFunction GetNumberOfRequiredTokens(ByVal typeOfPerson As PersonType) As Int32