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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:10:21+00:00 2026-05-14T19:10:21+00:00

I have a Contract class. The contract is valid 1 Jan 2010 – 31

  • 0

I have a Contract class. The contract is valid 1 Jan 2010 – 31 Dec 2010.

It can be in state Active or Passive, depending on which date I ask the instance for it’s state. ex. if I ask 4 July 2010, it’s in state Active, but if I ask 1 Jan 2011, it’s in state Passive.

Instances are created using constructor dependency injection, i.e. they are either Active or Passive already when created, null is not allowed as a parameter for the internal state member.

One initial/created vertex is drawn in a UML state machine diagram.
I have two arrows, leading out from the initial vertex, one leading to state Active and the other to state Passive.

Is this a correct representation of dependency injection in UML ?

The question specifically concerns statemachine diagrams where the first state after the initial state/vertex, is decided outside the boundaries of the diagram.

The Jude/Ashtah tool allows these kinds of constructs, i.e. drawing multiple lines from the inital vertex of the diagram, which leads me to beleive that it is correct UML graphical syntax.

This is related to
How model statemachine, when state is dependent on a function?
which initiated the question on how to model DI in general, in UML.

  • 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-14T19:10:22+00:00Added an answer on May 14, 2026 at 7:10 pm

    you can solve the states part as I suggested in your other question and the DI can be shown using the dependency in class diagram.

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

Sidebar

Related Questions

I have a Contract class. The contract is valid 1 Jan 2010 - 31
I have this class which i would like to map: public class Contract {
I have a model called Contact which has_one guest like so. class Contact <
Im building a Hibernate Criteria that will fetch all Appartments with a valid contract-date.
I have this class: class Contract(db.Model): book_number = db.IntegerProperty(required = True) initial_page = db.IntegerProperty(required
I have 3 domain classes: class Contract { String referenceNumber static belongsTo = [subCategory:SubCategory]
I have this database in GAE: class Contract(db.Model): # I renamed Act as Contract
I have a 'Contact' class with two properties : firstName and lastName. When I
I have a class Contact (base class),a class called Customer and a class called
I have two models: class Contact(models.Model): name = models.CharField(max_length=255) class Campaign(models.Model): contact = models.ForeignKey(Contact,

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.