1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf What is So"ware Design? https://medium.com/t%C3%BCrkiye/yaz%C4%B1l%C4%B1m-tasar%C4%B1m%C4%B1-nedir-cd8aad12c8ae Türkçe Çevirisi: Muhammed Hilmi Koca
an exercise in managing complexity Jack W. Reeves What is Software Design? The C++ Journal Vol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
coded and tested Testing is part of the process of refining the design Jack W. Reeves What is Software Design? The C++ Journal Vol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
the needs of its populace. So!ware-intensive systems are like that. Grady Booch Developed UML Wrote foreword to “Design Patterns” and “Technical Debt” books Istanbul, Turkey Credit: European Space Imaging
= new CookingEvent(); public void cook(Cake cake) { prepareIngredients(); int numberOfLayers = cake.getNumberOfLayers(); cakePowder = new BrownCakePowder(); float weight = cakePowder.getWeightUsed(); Egg egg = new Egg(); egg.crack(); cake.getChef().getCompany().registerEvent(event); } private void prepareIngredients() { // prepare ingredients here ... } } Don't talk to strangers Law of Demeter do not reach into an object to gain access to a third object’s methods 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 example of high coupling
private String message; private String username; public EmailMessage(String to, String sbj, String m) { this.sendTo = to; this.subject = sbj; this.message = m; } public void sendMessage() { // send message using sendTo, subject, message } public void authenticate(String username, String pass) { this.username = username; // code to login } } A cohesive module performs a single task within a so!ware procedure, requiring li#le interaction with the procedures being performed in other parts of the program 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 example of low cohesion
mistakes, more likely to over design, and more likely drop the other practices, particularly under pressure. Kent Beck The creator of extreme programming One of the signatories of the Agile Manifesto Pioneered software design patterns and TDD — from book “XP Explained” by Kent Beck
Higher morale Be"er collaboration Shared knowledge Quicker to market Automatic code review Useful for training people Lower defect rates https://www.flickr.com/photos/fraserspeirs/3394902061 Joe O'Brien and Jim Weirich while doing ruby code review Benefits of Programming in Pairs
why you are doing or how you are doing (how) (what-generic) (what-specific) mailer.use_gmail_smtp_send_email() mailer.send_email() mailer.send_activation_email() Give great names. because you have to live with them forever
wrapper interceptor controller parser service validator converter gateway generator Avoid using honeypot names a!racting behaviors and functionalities Give great names. because you have to live with them forever
leaky. Abstractions fail. Sometimes a li!le, sometimes a lot. There’s leakage. Things go wrong. It happens all over the place when you have abstractions. https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/ Law of Leaky Abstractions
Framework slave coding Composition over Aggregation Premature optimization Primitive obsession Huge upfront design Checked exceptions Stop, or use them wisely