Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:02:19+00:00 2026-06-14T23:02:19+00:00

Okay so I’m a bit confused as to when I should add an attribute

  • 0

Okay so I’m a bit confused as to when I should add an attribute to a class vs drawing an association to a class when trying to show a relationship in a UML diagram.

For example let’s say I have a DFA class that contains 10 state objects each having a different set of paths to various states in the DFA. Should I draw the composition line from the DFA to the State class or just type all 10 states in the attribute section of the DFA class.

Basically I’m trying to figure out if when a Class A contains (or is composed of) one or more Class Bs, should I draw a line (aggregation, composition,association dependency etc) between them or just put one as an attribute to another.

This article attempts to answer the question but I get confused as soon as he starts talking about the diagrams he drew.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:02:21+00:00Added an answer on June 14, 2026 at 11:02 pm

    The article you pointed gives one guideline:

    In the years I’ve been working with different modelling teams I’ve found that the rule that works best is to use Associations for Classes and Attributes for DataTypes.
    A data type is a special kind of classifier, similar to a class. It differs from a class in that instances of a data type are identified only by their value.

    I kind of agree with the author, adding another point: your class diagram should be understandable. If you have a diagram with many lines crisscrossing each other the diagram is useless. When this happens you must try to find relations that can be modeled using attributes without loosing too much visual information, and replace them with attributes.

    Another thing that you can do with relations and not with attributes is to display bi-directional relations (you can do this with one attribute in each class of the relation, but you loose the semantics of the relation).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so the title may be a bit misleading. What I am trying to
Okay, I feel a bit foolish for having to ask this but I guess
Okay, I'm trying to reverse engineer a feature on a website I found -
Okay, so I have this class that basically acts as a manager of an
Okay, so first allow me to outline what I'm trying to do. I want
Okay I am trying to create an indexPath value from a NSArray of NSDictionary
Okay guys. What i'm trying to do is create an unordered list (ul) with
Okay so here is what I'm trying to accomplish. First of all below table
Okay, I've set up a bit of code which searching for all the pages
Okay, so I'm trying to make a game that uses this algorithm: http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.