Information and Communication Technology
Faculty of Applied Sciences
Rajarata University of Sri Lanka
Table of Contents
1. INTRODUCTION 1
2. ARCHITECTURAL DESIGN .1
2.1 HIGH LEVEL COMPONENT AND THEIR DESIGN 1
2.1.1 Component Design 1
2.1.2 Components 2-3
2.2. ARCHITECTURAL STYLES / PATTERNS 3
2.2.1 Component-Based Architectural Style 3-4 2.2.2 Object-Oriented Architectural Style 4-5 2.3 PHYSICAL ARRANGEMENTS OF DEVICES 5 2.4 DESIGN DECISIONS 6
3. COMPONENT AND DETAIL DESIGN 6
3.1 DESIGN PATTERNS 6-8
3.2 CLASS DIAGRAM 8
3.3 SEQUENCE DIAGRAMS 9
3.3.1 Use case 1: Currency Notes Recognition 9 3.3.2 Use Case 2: Location Recognition 9-10 3.3.3 Use Case 3: Color Recognition 10 3.3.4 Use Case 4: Light Detection 11 3.3.5 Use Case 5: Calculator 11 3.4 ALGORITHM DESIGN 12
3.4.1 Input Entering Algorithm 12 3.4.2 Currency Notes Recognition Algorithm 13 3.4.3 Current Location Recognition Algorithm 13 3.4.4 Destination Recognition Algorithm 14 3.4.5 Color Recognition Algorithm 14 3.4.6 Light Detection Algorithm 15 3.4.6 Calculator Algorithm 15-16 3.5 DATABASE DESIGN 17 3.5.1 Relational Model 17 3.5.2 Data Dictionary 17 3.5.3 Indexes 18 3.6. RULES AND GUIDELINES FOR INTERFACE DESIGN 18 3.7. USER INTERFACES DESIGN 19
REFERENCES 20
This Software Design Specification provides a complete description of all the design aspects, starting from the high level components of the system to the class level design of the project C4ME, a life management system for visually impaired people. It also includes the sequence diagrams and user interfaces.
This document forms the concrete basis for the implementation. So this is intended to be referred frequently in the implementation phase.
2. ARCHITECTURAL DESIGN
2.1 HIGH LEVEL COMPONENT AND THEIR DESIGN
2.1.1 Component Design
2.1.2 Components
Currency Notes Recognition
This component is responsible for recognize the currency notes in Sri Lanka. It will be developed using image processing techniques such as edge detection, segmentation, color, pattern recognition, Gaussian blur..etc. This sub-system gets scanned image of currency note as input and output the value of the note as a sound clip. It provides facility to identify whether image has been fully scanned or partially since the application end user will be a blind person. Once it scans the image it will out put the sound clip saying the value of the currency note.
Location Recognition
In this component there are two other sub components. They are,
– Current location recognition
– Destination recognition
Basically this Current location recognition sub-component is responsible for informing the visually-impaired person about where he is using GPS, Google map etc. In here the visually-impaired person is made aware on his current location. Also this component enables to inform nearby places of his current location over the voice.
The destination recognition sub-component is also responsible for providing the details of the position of the user. When a visually impaired person travels he/she can inform the destination to the system and it'll generate voice output when he/she will reach the destination. This component also uses GPS, GPRS etc. technology.
Color Recognition
This component does its job by informing the color/s of an object to the visually-impaired person. It scans the object and identifies color behaviors. Then according to the percentages of color pixels, system informs major and minor colors of the object as voice output.
Light Detection
Informing whether the bulbs are on or off is handled by this component. To accomplish this, we will scan the image of the light and use the intensity levels of colors spread over the scanned image. Using the result of scanning, this component is capable to making aware of the bulbs are on or off, to the user.
Calculator
This component is newly added to the application according to the clients’ requirements. As the difficulty of calculations in touch phones, It gives the solution as providing user friendly calculator. In here we will implement a calculator which provides basic mathematical functions like summation, subtraction, multiplication, division, square root and square finding etc. From a single tap generate a voice output which reads the value of the touched number and from a double tap the pressed number will entered to the screen. Double tapping on the ‘=’ mark a sound clip will be generated telling the answer of the calculation.
Talking Tutorial
This component is the user manual of the system. The system is basically intended to blind people so it has embedded recorded audio instructions to guided user to optimize the usage of the application. User can listen to talking tutorial at the very first time and when he/she necessary.
2.2. ARCHITECTURAL STYLES / PATTERNS
“C4Me” will be developed under two main architectural patterns. As this is a ‘more in one’ type system for the development of the system will use the component-based architecture style to decompose the design further into independent components that expose the appropriate communication interfaces. Using the object-oriented design approach for these components will improve reuse, testability, and flexibility.
Explanation of used architectural styles
2.2.1 Component-Based Architectural Style
Component-based architecture describes a software engineering approach to system design and development. It focuses on the decomposition of the design into individual functional or logical components that expose well-defined communication interfaces containing methods, events, and properties. This provides a higher level of abstraction than object-oriented design principles, and does not focus on issues such as communication protocols and shared state.
The reason for the decision:-
Since this system is a collection of sub systems we need to clearly divide it into components. Also we use some methods in multiple components such as color identification method in both currency notes recognition and color recognition components, voice generation function in all components, gps connection function in two of location recognition component…etc. Therefore some methods, events need to be reused. Also the components are designed to have minimal dependencies on other components. Therefore components can be deployed into any appropriate environment without affecting other components or sub-systems.
Benefits of using Component-Based architectural style
• Ease of deployment. As new compatible versions become available, we can replace existing versions with no impact on the other components or the system as a whole.
• Reduced cost. The use of third-party components allows spreading the cost of development and maintenance.
• Ease of development. Components provide defined functionality, allowing development without impacting other parts of the system.
• Reusable. The use of reusable components means that they can be used to spread the development and maintenance cost across several applications or systems.
• Mitigation of technical complexity. Components mitigate complexity through the use of a component container and its services. Example component services include component activation, lifetime management, method queuing, eventing, and transactions.
2.2.2 Object-Oriented Architectural Style
Object-oriented architecture is a design paradigm based on the division of responsibilities for an application or system into individual reusable and self-sufficient objects, each containing the data and the behavior relevant to the object. An object-oriented design views a system as a series of cooperating objects, instead of a set of routines or procedural instructions. Objects are discrete, independent, and loosely coupled; they communicate through interfaces, by calling methods or accessing properties in other objects, and by sending and receiving messages. The key principles of the object-oriented architectural style are Abstraction, Composition, Inheritance, Encapsulation, Polymorphism and Decoupling.
The reason for the decision:-
Since we have objects with same attributes and methods as well as inheritance classes we need to highly used object oriented architectural styles. Objects can inherit from other objects, and use functionality in the base object or override it to implement new behavior. Moreover, inheritance makes maintenance and updates easier, as changes to the base object are propagated automatically to the inheriting objects. Also the polymorphism concept allows overriding the behavior of a base type that supports operations in the application by implementing new types that are interchangeable with the existing object.
Benefits of using Object-Oriented architectural style
• Understandable. It maps the application more closely to the real world objects, making it more understandable.
• Reusable. It provides for reusability through polymorphism and abstraction.
• Testable. It provides for improved testability through encapsulation.
• Extensible. Encapsulation, polymorphism, and abstraction ensure that a change in the representation of data does not affect the interfaces that the object exposes, which would limit the capability to communicate and interact with other objects.
• Highly Cohesive. By locating only related methods and features in an object, and using different objects for different sets of features, we can achieve a high level of cohesion.
2.3 PHYSICAL ARRANGEMENTS OF DEVICES
Since C4Me is not access servers, internet or any other components and it is only a mobile application which interact directly with the user, we need devices to arrange physically only for the location recognition component. Following is the physical arrangements of devices for the location recognition component.
2.4. DESIGN DECISIONS
Object Oriented Software development Methods is used.
Reason:
Since Object Oriented Software development methods are possible to directly represent real world objects in the computer system and this system is used mostly within a specific set of users, we focuses on improving the maintainability and reusability of system through a set of techniques, notations, tools, and criteria.
Because this is a system for visually impaired people it should be reliable. Object-oriented system promise to be far more reliable than traditional systems, primarily because new behaviors can be "built" from existing objects.
3. COMPONENT AND DETAIL DESIGN
3.1. DESIGN PATTERNS
Design patterns are proven solutions approaches to specific problems. A design pattern is not a framework and is not directly deployed via code.
Design Patterns have two main usages:
• Common language for developers: They provide developers a common language for certain problems. For example if a developer tells another developer that he is using a Singleton, another developer (should) know exactly what this means.
• Capture good practices: Design patterns capture solutions which have been successfully applied to problems. By learning these patterns and the related problem, an unexperienced developer learns a lot about software design.
Following are design patterns we supposed to use in C4Me application.
Observer Pattern
The observer pattern defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically. The object which is being watched is called the subject. The objects which are watching the state changes are called observers or listeners.
Reason to use:
Sometimes we need to when one object is changed its’ state, all of its dependents to be updated automatically. (eg: When considering GPS ). Also we need to maintain consistency between objects and keep classes from becoming too tightly coupled, which would hamper reusability.
Prototype Pattern
Prototype pattern is used when the Object creation is a costly affair and requires a lot of time and resources and you have a similar object already existing. So this pattern provides a mechanism to copy the original object to a new object and then modify it according to our needs. This pattern uses java cloning to copy the object.
Reason to use:
We need to copy objects and specify new objects by changing its structure. The system needs independent of how its objects are created, composed, and represented. As an example in location recognition we need to use same type of objects with few differences in different classes.
Visitor Pattern
Visitor pattern is used when we have to perform an operation on a group of similar kind of Objects. With the help of visitor pattern, we can move the operational logic from the objects to another class.
Reason to use:
We have to perform similar operations on different classes and objects (for color recognition and currency notes recognition some similar operations). Visitor pattern facilitates to easily add new operations on a bunch of classes which have different interfaces.
Façade Pattern
One class has a method that performs a complex process calling several other classes.
Reason to use:
We need to reduce complexities of the system with the time constraints and to decouple sub-systems, reduce its dependency, and improve portability this pattern is used. Also to minimize the communication and dependency between sub-systems as this system is a collection of various components this design pattern is used.
Interpreter Pattern
Used to define a grammatical representation for a language and provides an interpreter to deal with this grammar.
Reason to use:
Since we use java, java compiler is an interpreter pattern that interprets the java source code into byte code that is understandable by JVM.
3.2. CLASS DIAGRAM
3.3. SEQUENCE DIAGRAMS
3.3.1 Use case 1: Currency Notes Recognition 3.3.2 Use Case 2: Location Recognition
Current Location Destination 3.3.3 Use Case 3: Color Recognition 3.3.4 Use Case 4: Light Detection 3.3.5 Use Case 5: Calculator 3.4 ALGORITHM DESIGN
3.4.1 Input Entering Algorithm
3.5 DATABASE DESIGN 3.5.1 Relational Model 3.5.2 Data Dictionary
CurrencyNotes
Field Data Type Null Description value int(10) No Value of the currency note color varchar(10) No pattern varchar(20) No
color
Field Data Type Null Description color varchar(10) No Name of the color rgb varchar(16) Yes rgb(0,0,0) format red int(5) No r value of a color green int(5) No g value of a color blue int(5) No b value of a color
3.5.3 Indexes
CurrencyNotes
Keyname Type Unique Column
PRIMARY BTREE Yes value
CCOLOR BTREE Yes color
CPATTERN BTREE Yes pattern
color
Keyname Type Unique Column
PRIMARY BTREE Yes color
RED BTREE No red
GREEN BTREE No green
BLUE BTREE No blue
3.6. RULES AND GUIDELINES FOR INTERFACE DESIGN
This system doesn’t have complex user interaction and all the processing part has been automated because of the intended end user doesn’t have that much of capabilities to interact with application interface. So we did not focus on attractive interfaces. It has embedded recorded audio instructions to interact with the user.
3.7. USER INTERFACES DESIGN
1. Main Interface of the System 2. Destnation Recognition- SetDestination – Province
REFERENCES
[1]M. Fowler, Chapter 4, Sequence Diagram Tutorial, UML Distilled, Third Edition
[2] Image Analysis-Intensity Histogram http://homepages.inf.ed.ac.uk/rbf/HIPR2/histgram.htm [3] Architectural Patterns and Styles http://msdn.microsoft.com/en-us/library/ee658117.aspx [4] Advantages and Disadvantages of Object-Oriented Approach http://www.dba-oracle.com/t_object_oriented_approach.htm [5]A Quick Introduction to UML Sequence Diagrams
http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/