Cr a fting Softw a re • Code is me a nt for hum a n consumption, a nd it’s me a nt for computer consumption. • Cre a ting softw a re together but not scr a mbled 3
Single Responsibility Principle (SRP) • Style a nd Comments • Do not Repe a t Yourselves (DRY) • Keep It Simple (KIS) • Dependency Injection (DI) • Error H a ndling 6
function should h a ve one, a nd only one, job. • Keep functions focused on a single t a sk. • Bre a k down your code into sm a ller, reus a ble modules or functions. • Ensure e a ch module or function h a s a cle a r, well-de f ined purpose. • 7
on) a re provided extern a lly r a ther th a n cre a ted intern a lly by the object itself. • Constructor injection: Dependencies a re p a ssed vi a the cl a ss constructor. • Setter injection: Dependencies a re provided through setter methods. • M a ke components more a ccessible to sw a p or extend without modifying the dependent cl a ss. 10
ss for your very own Story (in the Test Folder) • No m a in methods inside of cl a sses th a t should not h a ve them, i.e., m a in methods for testing your p a rt goes on the test folder • Only one single m a in method in the j a v a source folder • The m a in method st a rt with “Show the Project P a ge” 47
Winter 2026 Copyright. These slides can only be used as study material for the class CSC307 at Cal Poly. They cannot be distributed or used for another purpose.