Meaningless Drivel is fun!*
The moose likes Design and the fly likes OO design - Banking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Design
Bookmark "OO design - Banking" Watch "OO design - Banking" New topic
Author

OO design - Banking

Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Try to tell the story again, only this time in terms of what these candidate objects would be doing. Here you are stepping a little bit deeper into implementation thinking, but still not too deep. Give it a shot.

Creating a new account
The UI accepts input from the Customer, then it .... ( you finish this ).


Junilu - [How to Ask Questions] [How to Answer Questions]
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 329
The UI accepts input from the Customer, then the Banker validates the input details from the Customer and creates an Account. The Banker also ensures that the Account is opened with the minimum balance required for that type of Account.
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 329
Am I off the mark or have I missed something?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Still a little off. See if this gives you a better idea: UI accepts customer input. The CreateAccountService gets the information collected by the UI. The CreateAccountService organizes the information and creates a Customer and an Account. The CreateAccountService then tells the ArchiveService to store the Customer and Account information away somewhere safe. The ArchiveService goes to the back room and files away the Customer and Account information for later use. ArchiveService tells the CreateAccountService that the Customer and Account information has been stored away safely. CreateAccountService tells UI "It's done", UI displays a message "Your new account has been created!"
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Now try to add the parts about the initial deposit to that story while maintaining the "flow" and integrity of the story line.
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 329
Here's my version with the initial deposit. Hoping it's slightly better this time.

UI accepts customer input. The CreateAccountService gets the information collected by the UI. The CreateAccountService organizes the information and makes sure that the Customer has requested to make an initial deposit of at least the minimum amount needed for the account. The CreateAccountService then creates a Customer and an Account with the initial deposit the Customer wanted to make. The CreateAccountService then tells the ArchiveService to store the Customer and Account information away somewhere safe. The ArchiveService goes to the back room and files away the Customer and Account information for later use. ArchiveService tells the CreateAccountService that the Customer and Account information has been stored away safely. CreateAccountService tells UI "It's done", UI displays a message "Your new account has been created, and your current balance is $$!"
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Nicely done! Are you ready to start coding something?
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 329
Junilu Lacar wrote:Nicely done! Are you ready to start coding something?
Thank you Absolutely, looking forward to it!
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Ok, install JUnit if you don't already have an IDE that has it. The try to read up on basic usage and programming constructs in JUnit 4. I'm going to try to walk you through some Test-Driven Development.
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 329
I have the latest version of NetBeans, so I think it should have JUnit inbuilt. Do you suggest some place to start reading up on constructs in JUnit 4? I found this link:

http://www.vogella.com/tutorials/JUnit/article.html

Is that a good place to start?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Yeah, that tutorial looks very comprehensive.
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 329
I think I have now got a basic understanding of how JUnit works.
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 329
What should I start with first?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OO design - Banking
 
Similar Threads
PF Withdraw
Could anyone help me to analyze and design this problem
Timestamping in Hibernate
Constructor issues with creating a new checking account object.
public/private code