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

  • SEARCH
  • Home
  • 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 7853321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:38:55+00:00 2026-06-02T19:38:55+00:00

I am doing a UML model based on my ERD generated with MySQL workbench

  • 0

I am doing a UML model based on my ERD generated with MySQL workbench. But now i have a doubt about the primary and foreign keys representation in a class diagram.

In the traditional UML diagram we should include the primary keys as atributes of each class? For example, the id_user or the id_list ? And about the foreign keys ? These ones are ignored as attribute but reflected as associations?

thanks

  • 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-02T19:38:57+00:00Added an answer on June 2, 2026 at 7:38 pm

    First off: why do you want to draw it in UML? If you already have an ERD, what additional/alternate property do you want to illustrate with a UML class diagram that the ERD doesn’t give you?

    Why? Because UML is a tool. On the assumption the diagram is for human consumption only (i.e. you’re not code generating from it) then you should use UML to expose the information you’re trying to communicate.

    As a general standard UML says nothing about how you formalise identity (PK/FK). UML follows the OO idiom that every object has implicit identity – therefore you don’t need to specify it explicitly. So in the simplest case, you could:

    • list PK attributes as normal attributes;
    • ignore FK attributes altogether.

    If that meets your modelling needs then you’re done.

    As a second refinement, you could tag the PK attributes with an ocl isUnique() constraint, again ignoring the FKs.

    Another option would be to use the rules of Executable UML. It denotes both PKs (‘Identifiers’} and FKs (‘referential attributes’} directly on the class diagram. So it’s closest to capturing everything in the ERD.

    So in summary: there is no UML-imposed right answer. It all depends on what you want to communicate with the diagram.

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

Sidebar

Related Questions

Doing my first tryouts with foreign keys in a mySQL database and are trying
I am doing a UML modelation of a system in which I have to
Reverse engineering source code into a VS 2010 UML class model? I have a
I come from a computer science. background, but I am now doing genomics. My
Doing my first SL4 MVVM RIA based application and i ran into the following
Doing some jquery animation. I have certain divs set up with an attribute of
Doing a simple Squeryl database lookup, but trying to exclude a value. I've tried:
Introduction to the problem I have been taught about OO Analysis and Design through
I have designed UML diagrams in different tools (StarUML, BoUML, Papyrus, Omondo, Rational Rose,
Doing this works in IE7: <a href= target=_blank>Link</a> But in IE8 it open a

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.