Object Oriented Design 2

Object Oriented DesignIn the previous part of my Object Oriented Design Tutorial, I showed you how to build a Use Case, Object Model, Sequence Diagram and Class Diagram from scratch.

In this tutorial, I show you how to turn those diagrams into code and a working program. This is the process a person goes through to create excellent Object Oriented Designs. The code follows the video along with the digrams from last time.

If you like topics like this, it helps to tell Google with a click here [googleplusone]

If you know anyone interested in Object Oriented Design, feel free to share [nttfblike]

Code from the Video

COIN.JAVA

PLAYER.JAVA

COINGAME.JAVA

COINFLIPPINGGAME.JAVA

Object Oriented Design Diagrams

Click on the image below a few times to see it full screen

Object Oriented Design

18 thoughts on “Object Oriented Design 2”

  1. Great video series (as they all are)! One slight bug in the code is that it appears the coin is only flipped one time instead of once per game. (Random coin flip occurs in Coin’s constructor and a Coin object is only created once.) Still, I wish I could write virtually bug-free code off the top of my head as you can!

    1. Thank you very much 🙂 I’ll look into that bug and thank you for pointing it out. Sometimes I focus so much on the core subject that I let little silly things slip. Sorry about that

  2. The code in the video had players[0] and player[0] in CoinGame constructor instead of player[0] and player[1]. The code is correct in the hand out.

    Also the code ran correctly in video, so you may have edited it. Just an observation.

    As always awesome video.

  3. I just completed this. I tried to write the codes on my own using the SD/CD before looking at yours. It was fun! <3
    Niki

  4. Hello Derek,

    thank you so much for the effort of putting those videos together! I’m in the process of learning Java right now and your tutorials are making it so much easier to digest. Awesome work!

    Marc

  5. Hello Mr. Banas,
    I have a question to you which I was asked in an informal interview by a professor from NASA, he asked me, “can you write a compiler that takes your C# code and compiles it” (I suppose he meant without .Net framework or JVM and JDK?) . I was clueless and so much ambressed. I am just a university student not a great developer. I want to know is it possible that I can write my own compiler for my java or C# code? if yes please recommend any books for guidance. Humble thanks

    Raj

    1. Hello Raj,

      Yes you could, but it wouldn’t be that easy. You’d just convert the C# code into the native assembly language of the host computer that runs it. Engineering a Compiler is a pretty good book on compilers.

Leave a Reply

Your email address will not be published. Required fields are marked *