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 736947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:39:48+00:00 2026-05-14T07:39:48+00:00

Short question. How do you go about transposing UML diagrams into code? The class

  • 0

Short question. How do you go about transposing UML diagrams into code? The class diagram is an obvious one but what about others like Activity, Use Case, Sequence, State, Package, etc.?

  • 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-05-14T07:39:49+00:00Added an answer on May 14, 2026 at 7:39 am

    Wow, that’s really cool if you have all this prior to start coding 😉 This means someone made a decent job at modeling the expected software!

    That said, the various diagrams of UML can map more or less closely to the code. Here is my feeling about it generally speaking:

    • Class diagram. Maps one-to-one with code in most of the case. Can still be used during analysis to show concepts which won’t map one-to-one, but it’s quite rare.
    • Package diagram. Maps one-to-one with code in most of the case as well. I’ve never seen any usage of it other than to show the packaging of the actual sources.
    • Sequence diagram. Maps also fairly close the the code in most case. Except that some steps are frequently avoided in the sequence diagram, which would become to big otherwise. It still shows who calls who either directly or indirectly.
    • State diagram. This one is more abstract. It shows the various states of an element in the program (or the program itself) and can’t be transposed as-is; you will first need to decide how the state is stored/modeled. E.g. a state diagram to show the possible thread state in java does not map to something really directly visible in the code, but threads have a state, as indicated by the corresponding enum.
    • Activity diagram. Show the individual steps of an algorithm/program. While some things can be transposed fairly easily, such as loops, the implementation of some others, such as parallel activities, can differ in the code. The most obvious implementation for parallel activities would be to use threads, but that could well be JMS, depending on the granularity of the diagram. It still wont’t tell you what the logic of each step is, so there is definitively some work to interpret the diagram and implement it.
    • Use case. That’s one of the most important. It can not be transposed as-is, and you will need to think how to implement the use case, which can span from something very high level to something low level. There is not formulae for it.

    Conclusion: UML is a tool to describe software under various perspective. Some aspects can be transposed easily in code, some other are more abstract and can be implemented in various way, depending on the granularity of the diagrams.

    This is the distinction between design and development: the implementation is the refinement of the design into something really executable (the code), which may require more or less work depending on the granularity of the existing design.

    The dream would of course be to be able to generate UML out of code, and vice versa, but we are not there yet! It almost works for class diagram though 🙂

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

Sidebar

Ask A Question

Stats

  • Questions 403k
  • Answers 404k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The '.' matches every character and re.split returns everything that… May 15, 2026 at 5:20 am
  • Editorial Team
    Editorial Team added an answer Yes. You can also use a UIWebView. See this answer. May 15, 2026 at 5:20 am
  • Editorial Team
    Editorial Team added an answer Can you modify your kernel? You could introduce a method… May 15, 2026 at 5:20 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.