Monday, 29 August 2016

Data Dictionary

Data dictionary is used to store data item type and record types with other information. The information that is used it depends on the system which is being used. Data dictionary or data directories are used in creating and processing of the database and also it can store the database schema. In the early stage of design for collecting the information about the data then in this situation data dictionary play a vital role. The database administrator is responsible for controlling the access of data dictionary but the user should not aware. Actually dictionary contains a metadata. Data about the data in the database is called a metadata.
There are two types of data dictionary. 
If database management system has a data dictionary as a part then this type of data dictionary is called integrated data dictionary.
If data dictionary is not a part of particular database management system so we refer to it as a freestanding data dictionary. The difference between integrated and freestanding data dictionary is that integrated data dictionary is most important not only in design phase but also perform many function throughout the working of the database on the other hand freestanding data dictionary is used in initial design stage. Integrated data dictionary can be active or passive. In active integrated data dictionary, when database is processed then database management system check it every time. Active data dictionary is maintained automatically by the system because active dictionary is attached with actual database structure. But passive dictionary is not checked every time when database is processed. Why data dictionary is used??? What is the purpose of data dictionary??? What functions data dictionary offered??? 
The data dictionary performs a many function. Data dictionary provide a control over data as a resource because in data dictionary data is store in a central location. 
An exact definition of each item must be developed for the storage in the data dictionary. Data dictionary help to communicate with users. 
Data dictionary knows the interest of each person on the item. 
Redundancy and inconsistency in data item name is checked. Synonyms are accepted in the database. What is synonym???? Different names for the same items is called synonyms. Homonyms are never accepted in the databases. What is homonyms??? Identical names for different data item is called homonyms.
The changing (the addition of new data item and alterations in data item description) in the databases structure are identified. These changes are recorded in the data dictionary. 
The data dictionary is responsible for determining the impact of changes in the database structure. The database administrator notices the effects of these changes. The external, logical and physical models are recorded and mapping between models are also recorded. Data dictionary store the information about the identities who access the each item. The person who is responsible for updating each item must be listed in data dictionary.  


Class Diagram

 In the system model when to show the classes and their associations between these classes we used class diagram. The class diagram shows the classes, their attributes, operations and the relationship among objects. Objects represent anything in the real word for example a patient, a description, a doctor. Each object class is a definition of one kind of system object. Association between classes shows that there is a link between these classes. Each class has some information about associated class. The class diagram is a static structure of the system.
When developing a model the first step is to identify the essential object, these object is represent as classes.
 The way of representing the classes in the model is to write the class name in rectangular box. And association between classes is represented by drawing a line between classes. To define classes in more detail we add information about attributes (the characteristics of on object) and operations (the function performed by the object) of the classes.
Class diagram look like a semantic data model, semantic data model are used in database design they show the entities and relationship between attribute, and associated attributes. When developing an object-oriented system model we use class diagram to show classes and their relationship.

 Example of class diagram:-

  Loan account class diagram
In the UML attributes and operation are represent by extending the rectangle that represent class. The figure shows that the top of the object class is the name of the object class. Class attribute is in the middle of the section of the rectangle. Operation of the class is represents in the lower section of the rectangle. Loan account will have the attribute account name, date released, loan amount and loan account operation is renew () and extend ().
The class diagram also show how many objects are involved in the association of the classes. How many instances of the object are involved in the association are represented by different characters such as 0 indicate that no instance, 0..1 shows that no instance, or one instance, 1 show exactly one instance, 0..* shows zero or more instance,  * shows zero or more instance, 1..* shows that one or more instance.


                                   1:1 relationship between object

In this example each end is annotated with a 1, it means that there is a 1:1 relationship between objects of these class.  A student can live at one address at the same time and address can belongs to one student.
                    One and many relationship between objects
Generalization:-
                             In generalization learn the characteristics of classes. Different members of these classes have common characteristics. In generalization common information will be maintain in one place only. The generalization is shown as an arrowhead that pointing up to the more general class. The attribute and operation associated with super class are also associated with subclass. The subclass can inherit the attributes and operations from their super class. Subclass can have specific attribute and operation such as student name, address, phone number.  If changes are accepted then do not have to see at all the classes in the system to check that these classes are effect by the changes that are made.


                                 Generalization hierarchy

Aggregation:-
                        In aggregation one object is composed of other object. To show aggregation we use diamond shape next to the class that represent the whole. Object is composed of different part for example study for a course may contain of book, quizzes and recommendation for further reading.




                                The aggregation association


Three Level Architecture

The proposal for a standardized vocabulary and architecture for database system were developed and published in 1971 by the Database Task Group appointed by the Conference on Data Systems and Languages. 
A later similar architecture and vocabulary were published in 1975 by the Standards Planning and Requirements Committee of the American National Standards Institute committee on Computers and Information Processing, ANSI/X3/SPARC.
Database can be viewed at three levels of abstraction. These levels form a three level architecture (three models). The permanent structure of the database is called intension of the database. The information stored at a given time is called an extension of the database (database instance). For describing the structure of the database we use the database model. What is database model??? What is the purpose of database model????Database model is a collection of tools that may include a type of diagram and vocabulary and model gives a description of the data, the relationship between the data, constraints on the data. Database store the definition of the structure of database. Three level architecture is used to store different schema at different levels. There are several reasons to isolate the levels,
The same data can be viewed differently by different users. 
To change the physical structure such as to change the storage devices without effecting the database structure. 
The user is not bothered with the complexity of the database storage structures. 
Three Level Architecture have three views or levels 
1: External level /view
2: Logical or Conceptual level /view 
3: Physical or internal level /view
External level
                    External level consists of many different external models of the database. This level is explicitly an end users and present data as desired by the user of the database. Each user is interested in only some of their attributes and relationships and other attributes and relationships that is not of interest of users is actually present in the database but user will unaware of them. For example one user may believe dates are stored in the form (month, day, year) while another may believe dates are represented in the form as (year, month, day)
Database management system uses the external schema to create a user interface. User sees the database through this interface. It hides the conceptual, internal and physical details and not allows the user to see. In external level some views are virtual, it means that data is not present as such but created when needed.
Conceptual or logical level:
                       Conceptual level is a middle level in Three Level Architecture. The information about the structure of database is store in logical model. The complete description of the database content information is store in conceptual schema. Conceptual model supports external level. Conceptual schema is used to create the logical record interface. Internal level details not cross the conceptual schema. Conceptual level include entities their attribute and their relationship, constraint on data, integrity and security information. It is necessary that conceptual model should be able to modify to accommodate the changes that are made in external level otherwise it effect the levels of database. The change in conceptual model takes a lot of time and effort. 
Internal or physical level

                   Physical level is used to store data on storage media. It describes the data structure and file organization used to store data on storage devices. Data is store in binary format. Data compression can be performed to consume minimum space for data. Different encryption method is applied for the security on the data. At physical level data is in character format and managed by operating system. Internal schema describe the internal level they contain record definition, indexes, representation method of data. 

                                       Diagram of three level architecture



Data Independence

Data independence is a separation of data and application program. Data independence is one of the most important advantages of the three level architectures (3-L architecture). A traditional file processing system makes the application program and data dependent on each other, i.e. we want to make a change in the data we will have to make change in the associated application also.
 Data independence is automatically introduced to the system this facility is provided by three level architectures. In other words we can say that the major objective of the three level architectures is the data independence. If we do not have data independence then whenever there will be a change made to the internal or physical level the application will not be able to access the change made in the internal or physical level any more. As a result these applications will stop working and ultimately the whole system may fail to operate.
Once we have the data, database and data applications independent of each other we can easily make change to any of the component of the system, without effecting the functionality and an operation of other inter related component.
 Any change in the lower level of the three level architectures does not affect the structure or the functionality on upper level this is another advantages of data independence.
Data independence can be classified into two type based on the level at which the data independence is achieved.
·         Logical data independence
·         Physical data independence
1.    Logical data independence
Logical data independence provides the independence in a way that changes in the conceptual model do not affect the external views. Although we have data independence at different level but not all changes are accepted at different levels. There may be some changes which may cause damage or inconsistency in the database levels.
The change which can be done transparently may include the following
Adding a file to the database, adding a new field in a file, changing the type of a specific field
for example deleting an attribute from database structure this could be serious because any application using this attribute may not be able to run any more so having data independence available to us we still get problem after a certain change it means that before making a certain change its impact should also be kept in mind and changes should be made while remaining in the limits of the data independence.
2.    Physical data independence
Physical data independence is that type of independence that provides us changes transparency between the conceptual and internal level. I.e. the changes made to internal level shall not affect the conceptual level. Although the independence exist but should not exceed the liberty offered by the physical data independence.
The change which can be done may include:-
The change made to the file organization by implementing indexed or sequential or random access at a later stage, changing the storage media, or simply implements a different technique for managing file indexed or hashes.




Sunday, 28 August 2016

Boehm's spiral model

Spiral process model was proposed by boehm in1988. Spiral model is represented as spiral rather than a sequence of activities, from one activity to another activity. The software process has four phases. The innermost layer concerned with system feasibility. The outermost layer with requirement definition, the next layer with design and so on. Changes are result of project risk and risk management activities are used to reduce risk in the project. Both activity change avoidance and change tolerance are both combine in spiral model. Spiral model combine the feature of waterfall model, incremental model, evolutionary model based on risk patterns.
This model is used in information technology (IT). For large, expensive, and complicated projects the spiral model is suitable.
Spiral model is better than other software model b/c obvious identification of risk. Spiral model is important when requirement are complex and user is unclear of its own needs.
If research and exploration are expected than spiral model is used.

                                              Spiral model
                          Four phases of spiral model
Determine objectives:-
                            In first phase we determine the objective of the user and define the functionality of the software and constrain on functionality or (operation) must define.
Project risks are identified and strategies are plan according to risks detail management plan is drawn.
Identify and resolve risk.
                            In this step project team identify the possible risk in the software, and detail analysis is carried out. Risks reduction techniques are used to resolve the risks in the system. For example requirement are inappropriate than prototype of the system is developed.
Development and testing phase.
                            Design the new system to meet the requirement. Development model is selected. Such as integration of sub system is an identified risk than waterfall model is a best development model to use. And system is passes to testing phase to check that the new system meet the user requirement
Plan the next phase.
                      Individual unit are integrate and test the system as a whole, if system is work according to user requirement  the system is delivered to end user, if not than determine objectives of the user. The preceding steps are repeated until the customer is satisfied that the final product is achieved. Final system is tested thoroughly and routine maintenance is carried to prevent failure.
              Advantages and disadvantages of spiral model
        Advantages:-
   Analysis of risks and avoidance of risk is enhanced.
  Add the additional functionality in the system at the end.
  For Mission critical project spiral model is important.
          Disadvantages:-
High level of experts is required for risk analysis.
  Spiral model is costly.
  Success of the system is dependent on risk analysis phase.




Advantages and disadvantages of database system

Advantages of database system:-
                                              File processing system has many disadvantages. Database approach is used to solve the problem of file processing system. Some important advantages of database are as follow:
1.   Redundancy control:-
                               Redundancy means data is duplicated in the system and appeared many times in the system. But in database redundancy is control, redundancy control means that data appeared only once and is not duplicated.
For example the data of a student in college database stored in one table. The table can be accessed for different purpose. If student want to change address then the change is only made in one place due to this reason data is not duplicated in the system.
2.   Data consistency:-
                           Redundancy control means that data is consistent in database. Data appeared only once so it is easy to maintain. Any updation is required then data is updated at once it will effect at all places where that data is used in the database.
3.   Consistency constrain:-
                                Consistency constrain are the rules to enter data in the database. If these rules are not followed the data is not enter in the database. For example roll no of a student always is a numeric value (1, 2, 3……). If numeric digit is not entered in student roll no it will generate an error message.
Constrain can be applied to ensure that data is enter in a specific range etc. phone number always in a numeric digit.
4.   Data atomicity:-
                         Data atomicity means all steps to complete the process carried out as a whole or it should not take place at all. Database approach ensure data atomicity that means that data always consistent and correct.
For example a user deducts amount from an account A, and add amount in account B. if money is deduct from account A but does not add in account B this situation cause data inconsistent in database. Database does not allow such situation. In database approach either both step is carried out or not.
5.   Reduced development time:-
                                          In database data is more efficiently stored. So the program that used this data is easier to develop. So this reduced overall development time of application.
6.   Increased concurrency:-
                                    Two user access the same file at the same time this will cause the loss of information. A database system manage a concurrent access and ensure that such problem not occur.
7.   Data independence:-
                                In database approach data and application program are separated from each other. We change the storage structure of a data without changing the application programs.
8.   Compactness:-
                      Compactness means data is store in way that require less space in storage device. In database management system data is stored in compactness. It saves memory.
9.   Data security:-
                      Database provides a several level of security to protect data from illegal access. Security is maintains through password.  Not every use of database should be allowed to access all the data. For example data entry operator should only be able to enter data in database. Database provides a different level of security for different users of the system.

Disadvantages of database system:-
 Database approach has many advantages but some disadvantages of using database approach are as followed:-
1.    High cost of database system:-
2.    Higher hardware cost:-
3.    Higher programming cost:-
4.    More chance of failure:-
5.    Complexity:-

                                          






                                                             

Elements of entity relationship model

Entities
 Object is a physical object (thing, place, person) or have an abstraction (event, concept) in the real word.  Any object that exists and can be distinguish by other object in the real word and data is collected from it and maintained. The word entity is derived from Latin “ens”.  Entities make a difference between things existence and its qualities. Entity is represented by a rectangle and the name of the entity is written inside the rectangle.
 The examples of an entity
A college system may include entities like student, teacher, class, admission. And other examples of entity are
·         A particular employee
·         A customer
·         Country
·         Furniture
·         Doctor
·         Registration
A student is an entity but in a class student Ali of a student entity is an entity instance. An entity instance is a particular member of an entity class. Through abstraction we can identify the common attributes of entity instance.
For example in a BSC class student is called as an entity and Zoya, Ahmad, Ali is a member of class so it is called an entity instance.
Set of entities with same attribute is called entity type. For example collection of all books is called entity type. All entities in entity type share common characteristics. For example every student in a class have a roll no, name, address, marks attributes.
Entity may be strong, week and associated depends on the situation.
Attributes
Every entity in an entity type has an changeable characteristics. For example student ID, student name, student address and student email are his characteristics of a student. The color of a text, the color might be red, blue, yellow. These characteristics are called attributes or property. An attribute in an entity relationship (E-R) diagram is represented by an ellipse and the name of the attribute is written inside the ellipse.
Attribute may be simple, multi-valued and derived attribute.
Set of a possible value is called attribute domain. For example the domain for gender attribute is two. The gender can be male or female. Every attribute have an attribute domain attribute domain may be a discret values (1, 2) or a range of values (0 to 6).
Attribute domain help to maintain the integrity of a database. For example data type and range constrain are domain. The data type of a student roll no is integer so it can store integer value (1, 2, 3, 4 …… 100) and data type of a student name is string it can store only alphabetic characters (A to Z or a - z).
Attribute name and domain are part of intension of the model and value of a attribute is part of extension.
Relationships

Some entities have connection with other entities. This connection is called relationship. The entities that have a connection with other entities is a called participants. The relationship may be between different entities or itself. If all the entities of entity set participate in a relationship so this relationship is called total relationship and if some entities of entity set participate in a relationship then this relationship is called partial relationship. Relationship is shown by line between entities. Relationship between entities is simple or identifying relationship.

Data Flow Diagram And Their Symbols

Data flow diagram (DFD) and their symbols
Data flow diagram (DFD) has following features:-
v  Data flow diagram is a very simple and a standard way to represent database system information graphically.
v  Data flow diagram shows a flow of data in the system.
v  Data flow diagram shows a visualization of the data processing in the system.
v  Data flow diagram hides the complexity of the organization.
v  Data flow diagram is not like a flowchart.
v  Data flow diagram help in understanding that all the data and process are define.
v  Relationship between system and sub system are defines in data flow diagram.
v  Information about an input and output of the system are shows in data flow diagram.
v  Logical data flow diagram does not cause the problem of data duplication and redundancy.
Data flow diagram has a different level such as context diagram, o-level, 1-level etc to represent different aspect of the system. Data flow diagram represents a system in more detail.
The symbols that are used in data flow diagram to represent data flow, process, data store, input or output, files are as follows:-
1.    Input / output
              An Input and output is represented by a rectangular shape.

       
2.    Data flow
              Data flow is represented by an arrow line that is labeled with the name of data. A data flow symbol shows the flow of information from one entity to another entity.

3.    Process / function
                    A process is an action to achieve a particular result or output. In process, incoming data flow is transformed into outgoing data flow.  A process / function are represented by an oval or rounded rectangle shape.
 

4.    Data store
           Data store symbol is used to store data in the database. A data store is represented by rectangle shape that is open in one side and right side of the rectangle is double lines.

5.    Collector
Collector shows that data from different location is merge into a single location.

         
6.    Separator
       A separator is used to separate a thing into different particles.

7.    File / database
                 Database is represented by double line that is separated from one another and database name is written in between these lines.
  

Example of data flow diagram



                   Figure: data flow diagram of food order


Data flow diagram has some issue on the bases of its use
Data flow diagram focused on flow of information and does not provide any facility of decision making.  Physical data flow diagram creates an un-normalized database.