Object Oriented Design 7

Convert Sequence Diagram to Class DiagramIn previous tutorials I showed you how to make a sequence diagram. In this video, I’ll show you how to convert a Sequence Diagram into a Class Diagram. Here are the tutorials on making sequence diagrams if you missed them OOD Sequence Diagrams & Sequence Diagrams 2.

In this tutorial, I wanted to show step-by-step how sequence diagrams are turned into class diagrams. Then in the next video, I’ll turn them both into working code in about 10 minutes. The class diagrams used can be found below.

If you like videos like this, it helps to tell Google with a click here

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

Class Diagram

The sequence diagrams I used in this video, are available here OOD Sequence Diagram. Here is the class diagram created in the video.

---------------------------------
:Account
---------------------------------
- bankID:int
- acctNumber:int
- customerName:String
- acctType:String
- acctBalance:double
- pin:int
- stripNumber:int

- accountNumberIncrementor:int = 100000 (STATIC)

---------------------------------
+ Account(bankID:int, customerName:String, acctType:String, acctBalance:double, pint:int)

+ getBankID():int
+ getAcctNumber():int
+ getCustomerName():String
+ getAcctType():String
+ getAcctBalance():double
+ setAcctBalance(newAcctBalance:double):void
+ getPIN():int
+ getStripNumber():int

+ generateStripNumber(bankID):int 
+ generateAccountNumber(stripNumber:int, acctType:String)

_________________________________


ooooooooooooooooooooooooooooooooo


---------------------------------
:Card
---------------------------------
- pin:int
- stripNumber:int

---------------------------------
+ Card(stripNumber:int):void
+ Card(pin:int,stripNumber):void
+ getPIN():int
+ getStripNumber():int
+ setPIN(pin:int):void
+ setStripNumber(stripNumber:int):void

---------------------------------


ooooooooooooooooooooooooooooooooo


---------------------------------
:Customer
---------------------------------
- customersATMCard:Card

---------------------------------
+ Customer(newATMCard:Card):void
+ getATMCard():Card

---------------------------------


ooooooooooooooooooooooooooooooooo


---------------------------------
:BankComputer
---------------------------------
- bankID:int = 9
- bankName:String
- accounts:ArrayList<Account>

+ numberOfBanks:int = 0 (STATIC)

---------------------------------
+ BankComputer(String newBankName):void
+ addAcctToBank(newAccount:Account):void
+ getBankID():int
+ verifyTheStripNumber(theCard:Card):boolean
+ verifyThePIN(theTransaction:Transaction):boolean
+ requestWithdrawalAmt(theTransaction:Transaction):void

---------------------------------


ooooooooooooooooooooooooooooooooo


---------------------------------
:BankNetwork
---------------------------------
- banksInDatabase:ArrayList<BankComputer>

---------------------------------
+ addBankToNetwork(newBank:BankComputer):void
+ isATMCardsBankInNetwork(theCard:Card):boolean
+ getFirstTwoDigits(stripNumber:int):int (STATIC)
+ verifyThePIN(theTransaction:Transaction):boolean
+ requestWithdrawalAmt(theTransaction:Transaction):void

---------------------------------


ooooooooooooooooooooooooooooooooo


---------------------------------
:ATM
---------------------------------
- theTransaction:Transaction
- networkOfBanksOnATM:BankNetwork
+ userInput:Scanner (STATIC)

---------------------------------
+ ATM(networkOfBanksOnATM:BankNetwork)
+ isStripReadable(theCard:Card):boolean
+ isATMCardsBankInNetwork(theCard:Card):boolean
+ insertPIN(theCard:Card, pin:int):boolean
+ pickAcctToAccess():void
+ amountToWithdrawal():void
+ getTransactionInfo():void

---------------------------------


ooooooooooooooooooooooooooooooooo


---------------------------------
:Transaction
---------------------------------
- bankID:int
- currentDateTime:Date
- customerName:String
- acctBalance:double
- withdrawalAmt:int
- acctNumberUsed:int
- pin:int
- stripNumber:int
- acctToWithdrawalFrom:int
- didCardVerify:boolean

---------------------------------
+ Transaction(stripNumber:int)
+ getBankID():int
+ getCustomerName():String
+ setCustomerName(customerName:String):void
+ getCurrentDateTime():String
+ getPIN():int
+ setPIN(pin:int)
+ setStripNumber(stripNumber:int)
+ getStripNumber():int
+ setDidTheCardVerify(cardVerified:boolean):void
+ getDidCardVerify():boolean
+ setAcctToWithdrawalFrom(acctToWithdrawalFrom:int):void
+ getAcctToWithdrawalFrom():int
+ setWithdrawalAmt(withdrawalAmt:int):void
+ getWithdrawalAmt():int
+ getAccountNumberUsed():int
+ setAcctBalance(newAcctBalance:double):void
+ getAcctBalance():double

---------------------------------

7 Responses to “Object Oriented Design 7”

  1. Ron says:

    You are a Guru. If you don’t mind me asking, how long have you been working with Java? I have been attending programming meetings through here in Houston trying to expose myself to as many different programmers as possible to expand my own knowledge and none of them seem to possess the skill that you exhibit in your tutorials.

    • admin says:

      Thank you 🙂 I started using Java in 1995, but I considered myself a C / C++ / Assembler programmer back then. I then took on a big project with Java in 1999 and have been using it since then.

      I used to interview people all of the time a few years ago and I feel confident that you could get as good if not better than most software engineering graduates in 6 months if you really work at it. Work to get really good at the OO design process. Then have fun with the language. Make programs that you want to make that challenge you.

      After you get good with Java I’d then move toward C so you can speed up your Java programs. With those 2 languages you can do just about anything.

      I’m working to create a software engineering education on my site. After I finish with that, I plan on making games for at least a year after that using Java and C.

      • Ron says:

        Wow, Thank you for the advice! I would have to definitely agree with you that working hard on programming will result in better knowledge than a college education, because I attended Devry for a Bachelor’s in Comp Sci. I was sorely disappointed in what I had learned, because I got nothing from the programming classes that I did not already know from my books at home. The things I did learn where from classes I had no interest in, like psychology and dietary nutrition. Why I had to take those classes still boggles me.

        I found out about OOP design through the internet a few years ago, but never found any decent explanations until I discovered your OOP tutorials about a month or so ago. Since I am currently unemployed I have been spending pretty much every spare second working on these concepts until I get another job.

        The project I am currently working on is a Client / Server app. The server is a java program on my desktop that listens for the client to connect. The client is running on my Android phone, it connects to the server, the server authenticates the sent user name and password, and it has the ability to communicate via messaging (Like a chat program) to other clients that are connected to the server.

        Anyhow, I took up enough of your time, but thank you for the reply and great advice! I look forward to the software engineering education!

        • admin says:

          You’re very welcome 🙂 I think the problem with colleges all to often is that they pull information from just one book and often that book is poor. I try to pull from every book and focus on the best. I also am set straight if I ever make a mistake because my videos are analyzed while a professors lectures aren’t. The only thing I haven’t been able to deal with is the lack of one on one interaction.

          I love input from you guys because it makes me better. Eventually I hope to cover all of the main subjects instead of just programming, but I don’t want to move on until I think I’ve done all that I can. I share the dream that many have that we can provide a free education to the world. Thank you for helping me do that 🙂

          • Raj says:

            Your advice and comments are as useful as your tutorial videos.

            Your vision of free education is noble and revolutionary.

            Thanks for doing this.

            • Derek Banas says:

              Thank you very much for the kind words. More and more people in the world are starting to believe in a free education for all world wide. I’m very happy that I’m able to participate in this movement 🙂

              I answer all questions, but as you can see sometimes I get a bit overwhelmed. Thank you for being patient.

  2. muhammed says:

    thanks a lot you make me fired up to learn .

Leave a Reply

Your email address will not be published.

Google+