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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:18:01+00:00 2026-05-15T20:18:01+00:00

I am a bit confused about where to describe the algorithm I might use

  • 0

I am a bit confused about where to describe the algorithm I might use in some part of an application.

Let’s say I want to create a Use Case that describes how the User inputs a set of values and my application returns the average of those values (of course this is a dead-easy case, but its easier to explain it this way).

1. The User tells the System he wants to calculate the average of a set of numbers.
2. The System asks the User for a number.
3. The User tells the System a number.
Repeat steps 2-3 until the User tells the System there are no more numbers left.
4. The System returns the average of all those numbers.

Now, where should I state the algorithm behind calculating the average of the numbers?

What if instead of calculating the average of numbers, I had to change the configuration of a game, go to the next level, add users to a database given a set of conditions, etc?

I feel like I need to in some way formalize the knowledge I have of the domain, otherwise I might either forget it or even worse, assume I know things that only by writing down would I understand I don’t.

In other thread, topic, someone talked about business rules. From what I’ve read they seem to be put as small notes on class diagrams. Maybe I’m wrong? If that’s what they are, I find they too cumbersome to use for more complex algorithms.

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-05-15T20:18:02+00:00Added an answer on May 15, 2026 at 8:18 pm

    If you really want to stick with Use Cases you’d write one from the System’s functional viewpoint rather than that of the end-user. Maybe something like this:

    1. The systems starts up and zeros out its total and count variables.
    2. The system receives a number.
    3. It adds the number to the total and increments the count.
    4. Steps 2 & 3 repeat until the system is told to stop.
    5. When told to stop the system divides the total by the count and returns the result.

    Have a read of Alastair Cockburns excellent book “Writing Effective Use Cases“. It explains about having different levels of Use Case. Your initial example would be considered a User Goal (or Blue) Use Case whilst the steps above would be part of a Sub-Function (or Indigo) Use Case (it’s so simple it might even be classed as a Black Use Case and just merged into its parent).

    As other people are sure to say, sometimes a Use Case isn’t the best way to describe an algorithm and you should fall back to good old flowcharts, state charts, sequence diagrams or whatever. These tools are there for your benefit – don’t be constrained by forcing a particular method when it doesn’t work for you.

    EDIT

    @devoured elysium: In response to your comments I’ve added a few more notes below:

    When you’re identifying domain objects sometimes you need to think about unwritten objects. It all depends on how it has been written. So, in the example you gave, maybe the “System” is a “Calculator”, the variable being used to add the numbers up is an “Accumulator”, maybe there’s a “Queue” that receives the number. Could be that the number itself is an object of a type “Number” if that can have distinct behaviour like range validation, or input syntax checking. Is there a “Display” object that you need to consider?

    It depends on what you consider to be in the bounded context you’re dealing with. Maybe, from the User’s perspective, there is one context that just deals with “Calculators”, but the System’s viewpoint there’s another that speaks to a lower lever context with “Accumulators”, “ALUs”, “Bits”, “Words”, “Registers”, “Clocks”, “Latches”, etc. The further you go down in the Use Case heirarchy by asking “How?” the more technical the language is going to become. You need to decide which are Domain Objects and which are just Implementation Objects and that depends very much on the type of thing you’re trying to describe and build (and, to a great extent, who your audience is – ubiquitous langauge and all that!). Conversely, you can go up the stack by asking “Why?” the function is being performed.

    The primary actor of a Sub-Function Use Case is generally the same actor as that of the higher-level use case that calls it. For some “technical” Use Cases though, the primary actor will be a system component/subsytem. For example, a system message logging Use Case might have the calling subsystem as the primary actor – i.e. the entity that had the will/need to initiate the action, rather than the actor that was performing the task that caused that subsytem to need to log something.

    In this example, where the algorithm is so simple, I’d probably just Embed it into the main Use Case. However, if it was being used in multiple other higher-level Use Cases I’d make it Standalone so I could include it from the other documents. Just a functional decomposition approach.

    There are no hard-and-fast rules with this. It’s a style of working that you’ll evolve over time. As others have said, make sure that you’re familiar with the other forms of diagrams so that you can pick the right tool for the job. Remember that although a picture may be worth a thousand words sometimes you actually need those words too so don’t just rely on diagrams.

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

Sidebar

Related Questions

Perhaps I'm a bit confused about when to use the waitForPageToLoad command, but what
I'm a bit confused about the use of all the IEnumerable<T> extension methods, intellisense
I am a little bit confused about 2 things. Firstly when I create an
I am a bit confused about this. If you're building a distributed application, which
I'm a bit confused about the use of the Elastic IP service offered by
I am bit confused about the difference between the usage of std::remove algorithm. Specifically
I'm a bit confused about the exact use cases for jqueryui. What do you
I am little bit confused about what really a web service is. You say
I'm a bit confused about the difference between a facebook canvas application and a
I'm a bit confused about debugging on a device. When I use the emulator,

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.