Exercise 43. Basic Object-Oriented Analysis and Design

I’m going to describe a process to use when you want to build something using Ruby, specifically with object-oriented programming (OOP). What I mean by a “process” is that I’ll give you a set of steps that you do in order, but that you aren’t meant to be a slave to or that will totally always work for every problem. They are just a good starting point for many programming problems and shouldn’t be considered the only way to solve these types of problems. This process is just one way to do it that you can follow.

The process is as follows:

1. Write or draw about the problem.

2. Extract key concepts from 1 and research them.

3. Create a class hierarchy and object map for the concepts.

4. Code ...

Get Learn Ruby the Hard Way: A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.