Class-Based Component Design: Principles & Process

Instructor: David Gloag

David has over 40 years of industry experience in software development and information technology and a bachelor of computer science

In this lesson, we'll take a look at class-based component design, the key principles that guide it, and the process used to implement it. At the end, you should have a good understanding of this design method.

The Tale of Parts

We live in a world that has many moving parts. Just consider the objects around you, your laptop, your cell phone or your car. They are complex objects, with hundreds if not thousands of moving parts. But even a simple object, such as a pen, has a number of moving parts. Software systems mirror this fact. Many pieces or parts interact to provide the functionality you expect. Take, for instance, a cell phone's instant messaging app. You have a part that displays information on the screen, another to capture the text you type, and still another that sends the information to the person at the other end of the connection. One way these parts are managed is to use the concept of components.

Software Components

A software component is a self-contained piece of software that contains or encapsulates a known set of operational units, relationships, and behaviors. Think of them as the building blocks for a system. You combine any number of these components to get the capabilities you desire. Often, they can be combined in more than one way. For example, consider a common bicycle. The wheels are considered a component, the handlebars are considered a component, and the seat is considered another component. Each provides an important piece of the whole.

Class-Based Component Design

Class-based component design is a method for designing software components. It uses a class or classes (a collection of related data items, and the operations needed to manipulate those items) to represent the component in question. Consider for a moment the email application on your personal computer. One component of this system might be an email message. If we define a class called 'EmailMessage', then a data item might be 'message', and an operation that can be performed on 'message' might be 'SendMessage'. It's likely that this will have more data and operations defined, but you get the idea.

Key Principles of Component Design

Because classes are used in this type of component design, they follow the same key principles. These include:

  • Modular - components by their very nature are self-contained units of functionality that are accessed and used in very specific ways.
  • Cohesive - components are meant to address a specific set of goals, normally small in number, and everything within them supports the component achieving that goal or goals.
  • Reusable - components aren't designed for just one project. Rather, they are designed to be used over and over, in any project that has a similar, or related need.
  • Well Documented - this goes without saying. How can a component be used or reused if no one knows how to use it?

Implementing Class-Based Component Design

As with the key principles, the implementation process follows class design for the most part. The main difference is that a component may involve more than one class. As such, the process may look like:

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account