Construction Problems

of 4
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Documents

Published:

Views: 8 | Pages: 4

Extension: PDF | Download: 0

Share
Description
As you Arrive… Snarf the RouletteRevised code. This is a new version of Roulette that I’ve modified exemplify problems with object construction similar to the Expression Hierarchy of Picassa .
Transcript
As you Arrive…Snarf the RouletteRevised code. This is a new version of Roulette that I’ve modified exemplify problems with object construction similar to the Expression Hierarchy of Picassa.Run and explore the code. Note that I’ve changed the way you pick a bet – now it just parses a bet like “even” and figures out the appropriate Bet subclass to use. As you look, answer to questions:I’ve added a new feature – it’s now possible to cheat. Figure out how to cheat and how cheating works.Where is the code that knows how much money a particular bet should pay out?Once you’ve finished that poke around and find a very ugly function in the code. That’s what we’ll be refactoring today.Construction ProblemsKey Points to Keep in Mind
  • Today we will explore 4 different solutions to the same design problem. All of them, I think, could be considered reasonable.
  • Not all designs are equally good. But sometimes the answer to what is the best design is “it depends”. It depends on the tradeoffs you’re willing to make.
  • In particular, you always pay for complexity (but very often that it worth it)
  • Key Points to Keep in Mind2. Design ideas come from the process of refactoring the code. When you simplify ugly code, new approaches often suggest themselves.4 Designs
    Recommended
    View more...
    We Need Your Support
    Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

    Thanks to everyone for your continued support.

    No, Thanks
    SAVE OUR EARTH

    We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

    More details...

    Sign Now!

    We are very appreciated for your Prompt Action!

    x