Hardware Verification with C++: A Practitioner's Handbook

Chapter 10: Designing with OOP

That's right! shouted Vroomfondel. We demand rigidly defined areas of doubt and uncertainty!

The Hitchhiker s Guide to the Galaxy , by Douglas Adams

Highlights

What is design? How do you go about designing with objects? As far as a CPU is concerned, you don t need objects. You might as well put all the code into one big function but that code would be really, really hard to understand. So we break up a single huge solution into a number of smaller, understandable, and rigidly defined pieces. This is the essence of design, regardless of the language.

When we design with OOP, this breaking up is really just the construction of a network of classes. However, before we dive into making classes, we need to understand the OOP design bias. OOP designs tend to focus on roles and responsibilities. These roles and responsibilities get broken down further into smaller networks of classes. Ultimately, we wiggle wires to communicate with the chip.

In this chapter we introduce some basic guidelines for design. We also talk a bit about some common design mistakes and how to avoid them.

Overview

Design is so intertwined with coding that it s artificial to separate the two. Academic textbooks explain that first you architect, then you design, and then you code. In the real world, however, these steps all get jumbled together. We tend to do all three at once, having a general idea of what we want to do, then refining and changing our idea as we...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Programming Languages
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.