How to Draw Context Diagram in Software Engineering

Context Diagrams!

Putting it in context.

Introduction

A context diagram is one of the first diagrams you lot will commencement creating when you lot begin looking at software design and development. It is a diagram which will help y'all define what the trouble is that your software is going to solve. It does this by showing who your system volition interact with and what data is incolved. Creating a Context diagram is non that difficult and it volition encourage you to consider several aspects of what you are going to produce which are useful before diving into the more serious aspects.

Context diagrams

A context diagram consists of a circle in the center which represents your arrangement. Around the outside are rectangles which represent the external entities that your system has to collaborate with. External entities could exist a person, or another concern, a arrangement etc. Joining the external entities to your organization are lines with arrows labelled with what data is transferred (or flows). These Data flows (sometimes referred to as relationships) are any piece of information (or information) which moves betwixt your system and an external entity.

Here is an example of a possible context diagram for an online store:

Context diagram example

  • External entities - Client, Depository financial institution, Manager, Warehouse Employee
  • Data flows - Product search query, Query results, etc.
  • System - Online Store

Data flows are shown merely cipher is said about the lodge in which the data flows, any logic regarding when and if data flows, how the data flows (what technology is used) or how much information flows.

A context diagram is too sometimes referred to equally a Level 0 Data flow diagram.

An external entity which your system receives data from may also be referred to equally a source. An external entity which your organization sends data to may too be referred to every bit a sink. An external entity may bo both a source and a sink.

A context diagram is a simple diagram but it helps yous in answering several important questions:

What does my organization need to produce? - Information technology defines exactly what it is that your organisation is to produce. The data leaving your organization and going to sinks are effectively the reason for the existence of your organization.

What resources does my system need to larn to do its thing? - The context diagram and then identifies what information is required in order to produce those outputs. The data originating at sources is effectively the raw materials required in order for your system to produce the required outputs. ie. data flowing into your organisation.

What is office of my organisation and what is non? - It defines the boundary of your system. This is very of import to get right and to become clearly represented. Everything inside the purlieus is your system. Y'all take control over information technology and responsibleness for how information technology is managed. Everything exterior the boundary you lot take no command over and is non your responsibleness. This is referred to equally the environs.

The means by which data flows between your system and the external entities is an interface. Whilst a context diagram doesn't define the interface, past identifying what information needs to menstruum and who it needs to flow to and from you are starting to lay the groundwork for what the interface needs to look like.

For almost systems the production of specific information is the central reason for the beingness of the software. The mangling of information is the main activity. For some systems, such equally games, other reasons such as entertainment are the main focus. When modelling a system such every bit this information technology can be catchy to model the arrangement effectively equally actions tend to be more than important than data.

Here is a possible context diagram for a chess game:

Context diagram chess game

Notice that multiple related pieces of data, which would normally menstruum at the same time tin can be listed together on the one data flow. Also, although at that place would be two players we don't stand for each player as an external entity. They both effectively send and receive the same data flows and then information technology would exist redundant.

You volition also detect that it leaves a lot of questions unanswered regarding the nature of the game. Is it single player (vs a n AI) or multiplayer or both? etc. For a game, the nature of the interactions are the principal focus of the system as opposed to creating and managing data. A context diagram is still a useful diagram to create in developing a game, it'southward just non equally useful as when developing an information based organisation.

Creating a Context Diagram

Creating a context diagram is easy. Creating a context diagram which is an accurate representation of your system can be difficult. Expect to get through several iterations, modifying your diagram as your understanding of the problem improves. In fact, if you are needing to update the diagram, that is peachy equally information technology shows you are developing a better agreement of the problem and / or the best solution required to solve it. These diagrams are created as a process to assist you lot by encouraging you to consider the project from a variety of perspectives. As such, the principal value in them is the thinking you do whilst creating and updating them every bit opposed to viewing them after they are finished.

You should consider these diagrams never finished only a piece of work in progress. Don't aim for perfection. These diagrams are a tool, not a product. Yous want to put enough time and effort into them that they attain their purpose but not so much that they detract from your cadre purpose which is developing the all-time system you lot can.

You are genearlly creating a context diagram every bit office of your software design and development, or to reply a question in an exam. The following steps tin make the process smoother:

As part of designing software

Step 1: Draw a circle in the center of your document and label it with a reasonable name for the organisation.

Step two: Think about who your external entities are and draw these in. This can be tricky. Information technology can be useful to first think about who your system is producing data for. And then piece of work backwards and think about where yous will get the data from in gild to exercise this.

Pace iii: Add in data flows from your system to sinks.

Step 4: Work out what data volition be required in order to produce the data flows in footstep 3 and add together these in equally well.

Step 5: Talk over this diagram with the customer (or other important stakeholders) and ensure that your understanding of the problem is the same as theirs.

To respond a question in an test

This is generally an easier job. In doing this you are commonly provided a scenario which yous are to create a context diagram for. The nature of this too dictates that it is usually quite a simple scenario and hence diagram yous are asked to draw out too.

Step 1: Read the question advisedly and highlight / underline cardinal $.25 of information (external entities, hints at data flows). Perhaps think about noting these down, just to the side as well.

Pace ii: Draw a circle in the center of your answer surface area and characterization information technology with a reasonable proper noun for the system (don't just write down 'system').

Step iii: Draw a rectangle for each of the external entities and characterization them. (to make things neater information technology is generally improve to put sources on the left and sinks on the correct)

Step 4: Add in the obvious and major data flows, then work backwards and make full in other data flows to brand the major ones make sense / be doable.

Here is an instance question:

A group of runners do a weekly run in a park. The number of runners partaking in the run is increasing and the organisers would like a organisation to help them continue rails of everyones runs. Each runner will go a runner id (which will be printed as a QR code on a ring the runners wear). The QR code will be scanned past a timekeeper as they complete the run. Their time taken will be stored in a database and runners can get a listing of times for all their runs from the arrangement. The organisers tin can also get a written report telling them how many people ran each week and other statistics. A lensman may be present and tin can upload pictures of the run into the organisation likewise.

Prove suggested highlighting : external entities, data flows

Show suggested respond

Context diagram runner example

A common mistake is to consider the database equally an external entity. It is in fact part of the system and then is not medelled inside a context diagram. Storage mechanisms for the data will be looked at in Information Catamenia Diagrams (which follow on from Context diagrams).

The rules

In producing an accurate and right context diagram the following rules should be observed:

Information may only period between exernal entities and the system. Data may not flow between two external entities. Information may actually flow between 2 external entities in the real earth just this is something which happens exterior of the boundary of our system and as such, does non show up in our diagram.

External entities should be listed as atypical not plural. At that place may exist a group of people (or things) which the external entity is representing but we are modelling an individual instance of them and then it is listed equally singular. eg. nosotros may accept a system which interacts with many clients but in our diagram our external entity would just be labelled as 'Client'.

Information flows can be general rather than specific. eg. we should list a data flow every bit payment details rather than listing all the individual elements of the payment details. This is meant to exist a broad, high level document and if we tried to list all the specific data the document would most likely become style too cluttered to hands read. It would also take too much fourth dimension and endeavor trying to get all the data accurate and complete which would distract us from the primary purpose of the diagram. We will bargain with more than specific information in afterwards diagrams.

It is also ok to leave minor ancilliary data flows out of the diagram (for like reasons equally stated in the previous paragraph). I would recommend you consider this only when modelling a larger, more complex system however.

Use descriptive names for everything (external entities, information flows, the organization). It should be obvious what they are without needing further explanation.

Model data flows only, not actions. eg. your diagram should not have data flows such as 'bill of fare option'. Determining what is data and what is an action can sometimes be tricky (when modelling a game in particular).

The following context diagram makes several mistakes. Tin can you identify what they are?

Context diagram mistakes example

Bear witness mistakes

  • Sick leave annotation - betwixt two external entities
  • Students - plural, non atypical
  • Query details - vague and non descriptive
  • Swipe access card - is an action, should instead be the data conveyed past the action (mayhap student ID)
  • Number present - could be more than descriptive, eg. Number students nowadays
  • System - should be a descriptive name of system, eg. Attendance manager

The large moving picture

A good context diagram sets a solid starting point for your software development. It should act as a reference betoken when considering other aspects of your design afterward on. Context diagrams are then expanded into Data Menses Diagrams which offset to look at how the inputs into your organization are transformed into the outputs.

A context diagram is also a document you should discuss with your client / stakeholders to help ensure you are working on exactly what it is intended you should be working on (and not a misinterpretation of information technology).

Summary

Organisation
The thing which we are modelling. Represented as a circle.
External entities
Things which our system interacts with either sending or receiving information or information. Represented as a rectangle.
Data flows
Data which moves to and from our system and external entities. Represented as a line with an pointer.
Source
This is an external entity which your organization receives data from.
Sink
This is an external entity which you send data to.
Boundary
This is the edge of your system.
Surroundings
Everything which is across the boundary and exterior of your organization. External entities exist in the environment.
Interface
The means exist which the external entities collaborate with your organization.
Answers multiple important questions
Which are important to consider when starting to plan and design your system.
Is a work in progress
As your understanding of the problem deepens you will ordinarily demand to update this diagram in accordance.

How to Draw Context Diagram in Software Engineering

Source: https://ryanstutorials.net/software-design-and-development/context-diagrams.php

0 Response to "How to Draw Context Diagram in Software Engineering"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel