Metro Media Player Chapter: 3 Designing the Project
3.1 Introduction
Design phase is the most important phase in the system. This phase is most time
consuming part of project. Design System Design Phase after the comprehensive
study of the existing system. If the analyst does not spend adequate time in
designing, he will not be able to fulfill the requirements of the user.
3.1.1. Multithreaded Design
Playing a media stream requires implementation of tasks such as reading media
stream from network or a storage device, de-multiplexing read media stream into
its elementary streams, decoding de-multiplexed elementary streams and
rendering decoded elementary streams. As seen in the Figure 3.1 each task has its
own thread, therefore tasks are running continuously and independently. Each task
reads input data from a circular buffer and writes to another circular buffer after
processing it. So, implementation of a task can be done in any way if it is
compatible with the read and write interfaces of these circular buffers. This makes
the abstract implementation of tasks possible and the design gains modularity.
Furthermore delay in a task can be compensated by circular buffers between the
said task and its dependent tasks since playing audio is a continuous process, it must
be done within a dedicated thread. Audio driver of the system may implement this
thread internally, so a dedicated thread created by the application programmer may
be unnecessary. Although, realizing said tasks serially without using dedicated
threads is possible, it requires a tight timing, and therefore this design is more
convenient for real time operating systems.
3.2 Preliminary Design
It is partially first to design how the system will look and respond to user before
designing the software structure. Prototyping of the new system should be design in
order to check the respond of user who actually uses the new proposed system.
The presented player in this thesis has a modular and heavily multithreaded design
that makes it more maintainable and scalable. As seen in the Figure 3.1, a Metro
media player is composed of buffers which are shared via concurrent
processes (threads) and modules which are responsible to realize a specific task such
22
Metro Media Player Chapter: 3 Designing the Project
as demuxing, decoding, etc.
Figure 3.1. The design of the media player
3.3 Detail Design
In the detail design the actual contents of each module in the preliminary design are
planned. Designing each module is rich like writing short programs. Following is
partial list of those design activities, which are used in design phase:
Design of input.
Design of output.
Design system flow charts.
A very important issue in building a software system is deciding, which
programming language is used? Often success or failure of the system can depend on
the choice of the language.
3.4 Design Approaches
Design method and strategies are tools for the designer. The common design
methods are given below:
Top down approach.
23
Metro Media Player Chapter: 3 Designing the Project
Bottom up approach.
The method adopted in designing a new system is known as structured design
approach, it is viewed as top down approach.
The reasons for selecting this approach is the structured methodologies based on the
building of logical module of the system i.e. identify the major components of
system, decomposing them into their lower level, components are interacting until
the desired level of detail is achieved.
Structured design approach is realized through its rich set of analysis and design tool
each of which serves a particular purpose in developing its specification like.
3.5 Architectural Representation (Architecture Diagrams)
To show the architecture of unique Media Player System the DFD Data Flow
Diagrams can be used.
3.5.1 DFD (Data Flow Diagram)
A data flow diagram is graphical tool used to describe and analyze movement of data
through a system. These are the central tool and the basis from which the other
components are developed. The transformation of data from input to output, through
processed, may be described logically and independently of physical components
associated with the system. These are known as the logical data flow diagrams. The
physical data flow diagrams show the actual implements and movement of data
between people, departments and workstations. A full description of a system
actually consists of a set of data flow diagrams. Using two familiar notations
Yourdon, Gane and Sarson notation develops the data flow diagrams. Each
component in a DFD is labeled with a descriptive name. Process is further identified
with a number that will be used for identification purpose. The development of
DFD’S is done in several levels. Each process in lower level diagrams can be
broken down into a more detailed DFD in the next level. The lop-level diagram is
often called context diagram. It consists a single process bit, which plays vital role in
studying the current system. The process in the context level diagram is exploded
into other process at the first level DFD.
24
Metro Media Player Chapter: 3 Designing the Project
The idea behind the explosion of a process into more process is that understanding at
one level of detail is exploded into greater detail at the next level. This is done until
further explosion is necessary and an adequate amount of detail is described for
analyst to understand the process.
Larry Constantine first developed the DFD as a way of expressing system
requirements in a graphical from, this lead to the modular design. A DFD is also
known as a “bubble Chart” has the purpose of clarifying system requirements and
identifying major transformations that will become programs in system design. So it
is the starting point of the design to the lowest level of detail. A DFD consists of a
series of bubbles joined by data flows in the system.
3.5.2 DFD Symbols:
In the DFD, there are four symbols
A square defines a source(originator) or destination of system data
An arrow identifies data flow. It is the pipeline through which the
information flows
A circle or a bubble represents a process that transforms incoming data flow
into outgoing data flows.
An open rectangle is a data store, data at rest or a temporary repository of
data
Source or Destination of data
Data flow
Process that transforms data flow.
Data Store
25
Metro Media Player Chapter: 3 Designing the Project
Figure 3.2 DFD Symbols
3.5.3 Constructing a DFD
Several rules of thumb are used in drawing DFD’S:
Process should be named and numbered for an easy reference. Each name
should be representative of the process.
The direction of flow is from top to bottom and from left to right. Data
traditionally flow from source to the destination although they may flow back
to the source. One way to indicate this is to draw long flow line back to a
source. An alternative way is to repeat the source symbol as a destination.
Since it is used more than once in the DFD it is marked with a short diagonal.
When a process is exploded into lower level details, they are numbered.
The names of data stores and destinations are written in capital letters.
Process and dataflow names have the first letter of each work capitalized.
3.5.4 Data Flow
A Data Flow has only one direction of flow between symbols. It may flow in
both directions between a process and a data store to show a read before an
update. The later is usually indicated however by two separate arrows since
these happen at different type.
A join in DFD means that exactly the same data comes from any of two or
more different processes data store or sink to a common location.
A data flow cannot go directly back to the same process it leads. There must
be at least one other process that handles the data flow produce some other
data flow returns the original data into the beginning process.
A Data flow to a data store means update (delete or change).
A data Flow from a data store means retrieve or use.
26
Metro Media Player Chapter: 3 Designing the Project
DATA FLOW DIAGRAM
Context Level Data Flow Diagrams
User Category
MM
Player
Zero Level Data Flow Diagram
Content File
Player Image File
27
Metro Media Player Chapter: 3 Designing the Project
Level 1 Data Flow Diagram
Handle Scroll
User
Open File
Manage Content
Manage Files
Mange Application
Handle images
Feasibility Conclusion
Figure 3.3 Data Flow diagram Media Player
28
Metro Media Player Chapter: 3 Designing the Project
3.6 Dynamic Model
The dynamic model represents the time-dependent aspects of a system. It is
concerned with the temporal changes in the states of the objects in a system. The
main concepts are
State, this is the situation at a particular condition during the lifetime of an
object.
Transition, a change in the state
Event, an occurrence that triggers transitions
Action, an uninterrupted and atomic computation that occurs due to some
event, and concurrency of transition.
3.6.1 Sequence diagram
A Sequence diagram is an interaction diagram that shows how processes operate
with one another and in what order. It is a construct of a Message Sequence Chart. A
sequence diagram shows object interactions arranged in time sequence. It depicts the
objects and classes involved in the scenario and the sequence of message exchanged
between the object needed to carry out the functionality of the scenario.
Media Player
Figure 3.4 Sequence Diagram of Media Player
29
Metro Media Player Chapter: 3 Designing the Project
Figure 3.5 Sequence Diagram of Media Player
3.7 Activity Diagram
Activity diagram are graphical representations of workflows of stepwise activities
and actions with support for choice, iteration and concurrency. In the Unified
Modeling Language, activity diagrams are intended to model both computational
and organizational processes (i.e. workflows). Activity diagram show the overall
flow of control. Activity diagrams are constructed from a limited number of shapes,
connected with arrows. The most important shapes types
Rounded rectangles represent actions
Diamonds represent decisions
Bars represent the start (split) or end (join) of concurrent activities
A black circle represents the start (initial state) of the workflow
An encircled black circle represents the end (final state)
30
Metro Media Player Chapter: 3 Designing the Project
Extraction
Figure 3.6 Activity diagram of Extraction
31
Metro Media Player Chapter: 3 Designing the Project
Rendering
Figure 3.7 Activity diagram of Rendering
3.8 Database model
A database model is a type of data model that determines the logical structure of a
database and fundamentally determines in which manner data can be stored,
organized, and manipulated. The most popular example of a database model is the
relational model, which uses a table-based format. Database system can be based on
different data models or database models respectively. A data model is a collection
concepts and rules for the description of the structure of the database. Structure of
the database means the data types, the constraints and the relationships for the
description or storage of data respectively. The model database is used as the
template for all databases created on an instance of MSSQL Server. Because temp
db. is created every time MSSQL Server is started, the model database must always
exist on a MSSQL Server system. The entire contents of the model database,
32
Metro Media Player Chapter: 3 Designing the Project
including database option, are copied to the new database. Some of the settings of
model is also used for creating a new temp db. During start up, so the model
database must always exist on a MSSQL Server system. Common logical data
models for database include
Hierarchical database model
Network model
Relational model
Entity-relationship model
Figure 3.8 for Database model
3.8.1 ERD
An entity-relation model (ER model) is a data model for describing the data or
information aspects of a business domain or its process requirements, in ab abstract
way that lends itself to ultimately being implemented in a database such as a
relational database. The main components of ER models are entities (things) and the
relationships that can exist among them. A well-developing ERD can provide
sufficient information for database administrator to follow when developing and
maintaining database.
33
Metro Media Player Chapter: 3 Designing the Project
Figure 3.9 ERD of Media Player
3.10 Class Diagram
34
Metro Media Player Chapter: 3 Designing the Project
The class diagram describes the attributes and operations of a class and also the
constraints imposed on the system. The class diagrams are widely used in the
modeling of object oriented systems because they are the only UML diagrams which
can be mapped directly with object oriented languages. The class diagram shows a
collection of classes, interfaces, associations, collaborations and constraints. It is also
known as a structural diagram. In the diagram, classes represented with boxes which
contain three parts
The top part contains the name of the class. It is printed in bold and centered,
and the first letter is capitalized.
The middle part contains the attributes of the class. They are left-aligned and
the first letter is lowercase.
The bottom part contains the methods the class can execute. They are also
left-aligned and the first letter is lowercase.
35
Metro Media Player Chapter: 3 Designing the Project
Figure 3.10 Class diagram of Media Player
3.10 Database Model
The data base Diagrams and table design show the entire data base Model which
given as below.
36
Metro Media Player Chapter: 3 Designing the Project
Figure 3.10 of Database Model
3.11 Graphical User Interfaces
Playing Audio
37
Metro Media Player Chapter: 3 Designing the Project
Figure 3.11 of GUI
Playing Video
Figure 3.12 of GUI
Selecting File
38
Metro Media Player Chapter: 3 Designing the Project
Figure 3.13 of GUI
Player Controls
Figure 3.14 of GUI
39