Tuesday, April 30, 2019

Class diagram

Just a note: the video for this did not record

Background

GW-Basic, Fortran, Cobol, Top to bottom
hard to debug, not reusable Goto
Structured programming c pascal ADA functions
code reuse -- call function, debugging was easier
Objects --break the code into natural groups of functions that
reflect the structure of what you are working with
door(lock), card, scan, user, validation,
Object contains fields and methods
C++, Java, C#, Objective C
Python, php, JScript, ruby

Theory

Abstraction--abstract classes, interfaces
Encapsulation--lego idea-- every class should be self contained,
internal should be private
Inheritance--get all the public fields and
methods from the parent classes
Polymorphism--different behaviors for different environments
Overriding and overloading

Diagrams

User Class

Lock Class

More complete diagram

No comments:

Post a Comment