Tutorials

OO PHP Part 3: UML, Classes and Relations

by John Kleijn on Jun 21, 2008 7:09:14 AM

Preface

Welcome to part 3 of this series.

There are many design theories, documented practices and paradigms. Before attempting to dive into any of those, it’s wise to have knowledge of a common way to communicate programming structures. UML provides an industry standard to do so.

There are many types of structures than can be communicated, and UML provides a standard for many of them. However in this article I will focus on one particular type of diagrams, class diagrams.

For this tutorial I recommend having a UML editor to experiment with recreating the given examples. The goal of this tutorial is to try to provide you the most commonly used toolset to start creating your own Class Diagrams. A list of editors is included in chapter 5.

This tutorial will allow you to better understand class relations, and the diagrams I will be using in the future tutorials, starting with some common Design Patterns in the next article.

Index

1. Introduction
1.1 What are class diagrams?
1.2 Class Diagrams: OOA versus OOD
2. Class Diagram Entities
2.1 Classes
2.2 Interfaces
2.3 Packages
2.4 Data types
2.5 Entity visibility
3. Relations
3.1 Associations
3.1.1 Bi-directional navigable association
3.1.1a Bi-directional association: code example
3.1.2 Uni-directional navigable association
3.1.2a Uni-directional association: code example
3.1.3 Association class
3.1.3a Association class: code example
3.2 Aggregation (aggregate association)
3.2.1 Regular aggregation
3.2.1a Aggregation: code example
3.2.2 Composite Aggregation (composition)
3.2.2a Composite Aggregation: code example
3.3 Generalizations
3.4 Dependencies
4. Stereotypes
5. In conclusion

Comments

For starters, I absolute love these tutorials. They go beyond just OO syntax to best practices and application design.
On a different note, you mentioned you would provide a list of free UML editor, but I haven't found this list.

1. judahtanthony on Jun 27, 2008 1:23:04 PM

Thanks. I forgot about that. Will rectify, later.

2. John Kleijn on Jun 28, 2008 11:50:41 AM

This is nice work. As a newcomer to PHP, this is easy for me to assimilate. Thanks.

3. loydster on Jun 30, 2008 2:04:53 PM

I'm glad you guys like it. I will be doing one more about Design Patterns before taking a break to work on a different project, after launch of that I will continue with part 5+ :)

4. John Kleijn on Jun 30, 2008 3:57:32 PM

Very well explained. Hope u'll write on the Observer pattern. How can we use that kind of pattern in php ?

5. abouchoud on Aug 21, 2008 8:56:38 AM
Login or register to post a comment.