Toggle navigation
TOC
Project Outline
Deliverables
Presentations
Examples
Coding Pattern: Classes and Objects
Classes
Classes: How do you decide what a class is and what it is not?
What is the domain or the problem space or the problem domain?
Look for Nouns!
Remember SRP: Single Responsibility Principle (see
Single Responsibility Principle
)
Ask yourself: “What does this class represent/do?”
Objects
Classes and objects are different!
Instance variables
Constructor (no destructor in Ruby!)
Methods: private/public
Polymorphism
When the same interface can be used with objects of different classes
Example: In ruby, message #to_s can be sent to objects of different classes
Why is it useful?
Ways to achieve this:
Inheritance
“Duck” Typing
“Duck” typing.
Don’t rely on the class/type of a thing to know what it can do
Reverse it: based on what it can do, you can tell the type of a thing.
How is duck typing is an alternative/complement to inheritence?
And what about Java interfaces?
Consider a method like #talk in a gaming application
Inheritance and Delegation
This is pretty subtle!
Inheritence: rarely is this the best solution
Consider Composition and Delegation: often a better solution
Look at this sample:
Ruby Inheritance Demo Code
Welcome
2018 Syllabus
Calendar of Lectures and homeworks
Resources
Lectures
Pilot Project
Welcome!
Lean Startup
Hypotheses
Working on Teams
MVP
Guest Lecture: Michael Skok
Pilot Project Conclusion
Term Project: Startup
Welcome to Term Projects!
Build Measure Learn
Project Planning
The Pivot
The Engine of Growth
Mockups & Prototypes
Testing Techniques
Term Project: Product
Product Market Fit
Jeffrey Beir: Metrics
Business Models
Pricing Models
Andy Payne: Startup Finance
Intellectual Property
Term Project: Business
Finance for Geeks
Founding a company
Real World Survival Kit
Management and Leadership
Dulcie Madden: Startup Teams
Last day converstation
Term Project
Term Project Outline
Minimum Viable Product Info
Hypotheses
Final Presentations
Background
Learning Goals
Grading
Teachers
Lexicon
Interesting links
Credits and acknowledgements