1 / 7

londonswcraft @londonswcraft

Crafting Object-Oriented Code. Sandro Mancuso @sandromancuso. http://www.londonswcraft.com @londonswcraft. London Software Craftsmanship Community (LSCC). http://www.londonswcraft.com @londonswcraft. Sandro Mancuso @sandromancuso. David Green @activelylazy. Bank Account Kata.

arva
Download Presentation

londonswcraft @londonswcraft

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Crafting Object-Oriented Code Sandro Mancuso @sandromancuso http://www.londonswcraft.com @londonswcraft

  2. London Software Craftsmanship Community (LSCC) http://www.londonswcraft.com @londonswcraft Sandro Mancuso @sandromancuso David Green @activelylazy

  3. Bank Account Kata Note: Stick to the features and take the simplest approach. We are not trying to create a real bank system here. Features Deposit, Withdrawal Transfer (optional) Account Statement (date, amount, balance) Statement printing Statement filters

  4. The Nine Rules1. Use only one level of indentation per method. 2. Don’t use the else keyword. 3. Wrap all primitives and strings. 4. Use only one dot per line. 5. Don’t abbreviate. 6. Keep all entities small (max 50 lines). 7. Maximum two attributes per class. 8. Use first-class collections. 9. Don’t use any getters/setters/properties. Object Calisthenics, Jeff Bay in: The ThoughtWorks Anthology, Pragmatic Bookshelf 2008

  5. The Nine Rules1. Use only one level of indentation per method. 2. Don’t use the else keyword. 3. Wrap all primitives and strings. 4. Use only one dot per line. 5. Don’t abbreviate. 6. Keep all entities small (max 50 lines). 7. Maximum two attributes per class. 8. Use first-class collections. 9. Don’t use any getters/setters/properties.RequirementsDeposit & WithdrawalTransfer (optional)Account Statement (date, amount, balance)Statement printingStatement filters

  6. Discussion Which rules... • were the most difficult to follow? • impacted your design? • will you try to follow in the future? • will you not try to follow in the future? Design • What's the name of the class containing the value? Is it immutable? • How did you test deposits and withdrawal? • Which classes did you end up with? • How did you implement the statement? • How far did you get?

  7. Thank you London Software Craftsmanship Community (LSCC) http://www.londonswcraft.com @sandromancuso References - Object Calisthenics, Jeff Bay in: The ThoughtWorks Anthology, Pragmatic Bookshelf 2008 - How Object-Oriented Are You Feeling Today? - Krzysztof Jelski

More Related