Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSE460 Lecture 10

CSE460 Lecture 10

Software Analysis and Design
Object-Oriented Principles


More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming


  1. jgs CSE 460 Software Analysis and Design Lecture 10: Object-Oriented

    Principles Dr. Javier Gonzalez-Sanchez [email protected] javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
  2. jgs 460 00001010 Abstraction § Reducing by focusing on the

    essential observable behavior § What will be outside? OOAD, Booch Textbook
  3. jgs 460 00001010 Encapsulation § Hiding the details of the

    implementation § What is inside? OOAD, Booch Textbook
  4. jgs 460 00001010 Hierarchical Relationships § Creating a hierarchy of

    abstractions § Who (is a…, uses a…, has a…) ? OOAD, Booch Textbook
  5. jgs 460 00001010 Polymorphism § The condition of denoting different

    forms. § A single name may denote objects of many different classes that are related by some common superclass. § When to use it?
  6. jgs 460 00001010 Concurrency § Having two o more events

    happening (objects acting) at the same time. § When to use it? OOAD, Booch Textbook
  7. jgs 460 00001010 Persistency § Property by which an object

    continues to exist even after its creator ceases to exist § Object serialization: convert it to a byte stream so way that the byte stream can be reverted into a copy of the object. § Save data OOAD, Booch Textbook
  8. jgs 460 00001010 Global Ideas § Create code Elegant and

    Efficient –Bjarne Stroustrup § Create code Simple and Direct –Grady Booch § Create code looks like written by someone who cares – Michael Feathers
  9. jgs 460 00001010 Clean Code Principles § Readability Use Meaningful

    Names for Classes, Methods, and Variables Follow coding guidelines: e.g., read the Java Style Reference § KISS (Keep It Simple by K. Johnson) for your reader Small functions that do one thing § DRY (Do not Repeat Yourself): Avoid Code Bloat § Decoupling
  10. jgs 460 00001010 Readability? § JFrame frmClient § JToggleButton btnNewButton

    § JLabel lblToggle § class MainWindow Create code Simple and Direct –Grady Booch Readability
  11. jgs 460 00001010 How many LOC per method? § around

    20 is perfect, § up to 50 is still fine, § up to 100 is critical, § above 150 is bad, and § more than 250 is !
  12. jgs CSE 460 Software Analysis and Design Javier Gonzalez-Sanchez [email protected]

    Fall 2020 Disclaimer. These slides can only be used as study material for the class CSE460 at ASU. They cannot be distributed or used for another purpose.