Heuristics for Determining Attributes

Heuristics for determining attributes

When working in object-oriented design, identifying the right attributes can seem challenging at first. But with the right guidance, it becomes much simpler. Heuristics for determining attributes provide practical rules to distinguish between classes and their properties, ensuring a clear and consistent model. These heuristics help refine system structure and improve design quality. In this article, I’ll share my personal approach to applying heuristics for determining attributes effectively.

Noun in Combination with a Genitive

Firstly, one trick I use is to look for nouns combined with a genitive. This typically points directly to an attribute. The structure usually reads analogous to “the X of the Y,” where “X” is an attribute of the class “Y.” For instance:

  • The date of the order
  • The diameter of the circle
  • The color of the car

In each of these examples, it’s clear that the attribute (date, diameter, color) belongs to a specific class (order, circle, car). Hence, what I love about this method is its simplicity. The sentence itself often gives away the class and its attribute without further interpretation.

Sentence Construction: Has

Another method that works for me is identifying sentences where a class “has” something. This often indicates an attribute. For example:

  • A person has a date of birth
  • An address has a postal code
  • The process has a transition time of…

These sentences suggest that the “has” relationship points to an attribute within a class. It’s straightforward. Moreover, this construction can also reveal relationships between classes.

Adjective in Combination with a Noun

Next, I consider adjectives combined with nouns. This combination usually hints at an attribute. Thus, consider these examples:

  • A fast car
  • A large display
  • A huge bank account
  • A red car
  • A black list

In these cases, adjectives describe a specific instance of a class, pointing to an attribute that needs to be identified. For instance, “large display” suggests that “size” is the attribute of the class “display.”

Adjectives with Nouns Example for Heuristics for determining attributes
Adjectives with Nouns Example

Sentence Structures: is

Sometimes, I encounter sentences structured as “ is ”. This structure doesn’t directly state the attribute but provides its value. For instance:

  • If the person is an adult…
  • If the application is approved…

Here, “adult” and “approved” are values of attributes like “age” and “status.” In this case it is essential to dig deeper and understand that the value refers to an attribute of the class, not the class itself.

Differentiating Objects

Finally, I always ensure that my objects are uniquely distinguishable. This is crucial in object-oriented modeling. To achieve this, I use different values of attributes to make each object unique. For example:

  • Modeling an object like “James Miller” with just two attributes — first name and last name — might not be enough. Adding a date of birth ensures that even if there’s another James Miller, the two can be distinguished.

In this case, “date of birth” serves as a critical attribute that differentiates objects within the same class.

Conclusion

In summary, heuristics for determining attributes involve a mix of language cues and logical analysis. By carefully examining the structure of sentences and the uniqueness requirements of objects, I can effectively identify and distinguish attributes. It’s a methodical approach that simplifies the modeling process, and with practice, it becomes second nature.

By integrating these strategies into your work, you’ll find that distinguishing attributes from classes becomes much easier. And don’t forget, graphical illustrations can be incredibly helpful in visualizing these concepts, making them easier to grasp for both you and your audience.

What’s Next?!

Now that you’ve learned how heuristics for determining attributes can sharpen your object-oriented models, it’s time to take the next step. In my upcoming article, “How to Determine Simple UML Relationships with Heuristics,” I’ll show how to apply similar principles to identify meaningful connections between classes. Join me to discover how these techniques make your UML diagrams clearer, more consistent, and easier to understand.

This text is based on content from the source: International Requirements Engineering Board (ireb.org). The International Requirements Engineering Board is the owner of the copyright.


Scroll to Top
WordPress Cookie Plugin by Real Cookie Banner