Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

ADO.NET and Disconnected Data Access-Implementation and Application in Computer Sciences-Project Report, Study Guides, Projects, Research of Applications of Computer Sciences

This project report is part of degree completion in computer science at Ambedkar University, Delhi. Its main points are: ADO.NET, Disconnected, Data, Access, Database, Technology, Interaction, Architecture, Connection, Provider, Dataset

Typology: Study Guides, Projects, Research

2011/2012

Uploaded on 07/16/2012

sameer
sameer 🇮🇳

4.4

(59)

85 documents

1 / 24

Toggle sidebar

Related documents


Partial preview of the text

Download ADO.NET and Disconnected Data Access-Implementation and Application in Computer Sciences-Project Report and more Study Guides, Projects, Research Applications of Computer Sciences in PDF only on Docsity! 6 1.6 Overview The remaining section of the document contains the overall description and Requirements Specifications. In overall description, general description about the project under discussion, working, activities involved in the project, constraints, assumptions and dependencies are discussed. In requirements specifications functional and non-functional requirements are described. 2 Overall Description 2.1 ADO.NET and Disconnected Data Access Majority if applications require data access mechanisms, making it a mandatory component when working with the web applications. A perfect interaction is made between data access mechanisms and a database, where all the data is stored. Different requirements are fulfilled by different applications in order to access the Databases. ADO.NET can be defined in terms of a database technology that is available within the .NET framework which is designed to support multi-tiered database applications. Disconnected architecture is being provided by ADO.NET which is provided over the internet and based on XML. In disconnected data access based database applications the importance of disconnected data operations can be felt as when connection establishment is not an easy task and a connection can be terminated at any time. The advantage of using disconnected data architecture is that in it database connections are resource- intensive and it ensures optimum utilization of the system’s resources. Also as the need of databases is expanding rapidly and more people are served in this manner, a connected data access model makes us questions about its complexity and productivity. An application based on connected data access model might support 1 or 2 clients but it might not do well when 100’s of simultaneous users are connected. So here the difficulty to have thousands of simultaneous continuous connections is not present [1]. docsity.com 7 2.2 ADO.NET Data Architecture Data access in ADO.NET relies on two components  Data Provider  DataSet Figure 1: ADO.NET Architecture 2.2.1 DataSet The “DataSet” is used to store and retrieve data from the data source. DataSet is also used for the modifications done in disconnected data access architecture instead of direct commands. The DataSet is most fundamental object in ADO.NET hierarchy and it is also fundamental to the disconnected nature of ADO.NET. The DataSet can also be described as a container for data which is held in memory. It permits data to be accessed when a docsity.com 10 c) The DataReader Object The DataReader object provides forward-only and read-only iterations through rows returned from a query. DataReader objects cannot be directly instantiated unlike the other components of the Data Provider. Instead, the Command object's ExecuteReader method returns a result set by means of a DataReader Object. The DataReader can provide rows of data directly to application logic when keeping the data cached in memory is not required. Because only one row is present in memory at a time, the DataReader provides minimum overhead in terms of system optimum performance but requires the efficient use of an open Connection object for the DataReader lifespan. d) DataAdapter To obtain the data from the Data Source and cache it locally, ADO.NET object “DataAdapter” as described in following figure [1], will be used. Also to fill the DataSet, a DataAdapter is used. To achieve discussed functionalities, DataAdapter must ensure a valid connection with the Data Source and then it retrieves data using SQL queries using ADO.NET “command Object”. Every DataAdapter can hold four commands which are Select, Insert, Update and Delete. A single DataAdapter object for multiple tasks such as insertion, deletion and updating will be used. docsity.com 11 Figure 2: A Disconnected Data Access model. e) DataRelation DataRelation objects are used to define how multiple DataTables are associated and linked. It is quite common to use this feature when dealing with tables that have a parent/child relationship. Using the characteristics of DataRelation object, navigation of the related data of the tables that have a parent child relationship can be very easily described. In disconnected data access, need to watch those cases where more than one user attempt to make conflicting changes at the same time or where changes are committed to more than one table. Also if a number of changes are made and committed all at once, problems and complexities can occur. In a simple one-page scenario, disconnected data access won’t give many problems [1, 2, 5, 6]. docsity.com 12 2.3 Updating Disconnected Data Updating the Data source is more complex operation than reading from it which depends upon the modifying operations which the DataAdapter need to perform. 2.3.1 Controlling Updates While using the linked tables, standard way of updating the data source can cause some problems, particularly if the records are added, updated and deleted. These problems occur because changes are not committed in the same order they were made. To track this DataSet object would need to store much information which would be a waste of memory on the server. It is required to monitor the cases where update operation is done for a record deleted. By using the features which are built into the DataSet we can get those rows that need to be added, updated or deleted into separate DataSets and chose an update order or by carefully controlling the insertion, modification and deletion operations that will not place the Database into an inconsistent state at any point. This will certainly add complexity and a considerable amount of extra code. So in those cases disconnected data access will be an extravagant solution to the problem that might get sorted easily [1]. 2.3.2 Concurrency Problems When a number of users try to update or modify the data at same interval, controls need to be defined so that adverse effects of modifications from other users are prevented on one user’s changes or modifications. ADO.NET keeps information in the DataSet about the current and the original value of every inch of information in the DataSet. When updating a row, ADO.NET searches for a row that matches every “original” field exactly and then updates it with the new values. If another user changes even a single field in that record while the program is working with the disconnected data, an exception is thrown. The update operation is then halted, potentially preventing other valid rows from being updated. Generally, there are three types of concurrency issues which occur during data manipulation activities: docsity.com 15 Figure 3: Client Server Physical model The necessary requirements are a relational database management system (RDBMS), such as MS-SQL Server, running on Windows Server and a PC running TCP/IP. The applications will be connected to the database server and will requests for the data. The server will than just returns the data which was requested by the client [8]. Request for data Requested data data data client client client server server Main network docsity.com 16 Figure 4: Logical view of Two Tier Architecture 2.4.2 Three Tier Environment In three tier environments, initially a host of “thin client” applications were developed. The “thin client” applications run the client/server model but from the web server. The client will only be displaying the user interfaces and data. The client has no role in producing the results. In following figures [8], the physical representation of three tier architecture and logical view of the three tier architecture are given. Client layer User interfaces, Data access, Business Rules Database Layer Client PC Physical boundary Database Server docsity.com 17 Figure 5: Three Tier Thin Client Architecture The advantage of three tier architecture is that here a well implemented web server can manage and channel database connections as well as running the applications. The disadvantage can be described from the fact that the web server quickly gets overwhelmed by requests and must either be upgraded or clustered [8]. Database server Thin Client Thin Client Thin Client Thin Client Thin Client Internet server docsity.com 20 c) Workflow Layer This is an optional layer which deals with data flow to and from the system. It may or may not interact directly with the user interface, but always deals with external data sources. For instance, if one sends or receives messages from a messaging queue, use a web service for extra information, send or receive information to another system, than the code to handle this would be in the workflow layer. One may wish to wrap the whole application in XML so for that the choice of presentation layer can be expanded. This would also be handled in the Workflow Layer. d) Presentation Layer It’s normally ASPX page or windows from. This layer includes all the classes that will help in presenting the data. This layer provides an interface for the end user into our application. Ideally, the event method implementations within the form classes will only contain calls the presentation layer classes. The web or windows forms, used for visual representation only interface seamlessly with the presentation layer classes which handle all translation between the business layer/workflow layer and the forms themselves. This means that any changes on a visual front can be implemented easily and cheaply. e) Data Access Tier This layer is where one will write some generic methods to interface with the data. This may be common to all projects if it’s novel or ideal one. For example, we write a method for creating and opening a Connection object (internal), and another for creating and using a Command object, along with a stored procedure (with or without a return value), etc. This Data Layer, obviously, contains no data business rules or data manipulation/transformation logic. It is merely a reusable interface to the Database. It will be called a Model which is independent of Control (Code Behind page) and View (ASPX Page) [8, 9]. docsity.com 21 2.5 Literature Survey The literature survey will also be conducted in order to get familiarized with the ADO.NET environment, ADO.NET structure and architecture. The literature survey will than facilitate in the enhancement of functionality and working of the model to be implemented on the basis of the knowledge which will be gathered from the literature survey. In literature survey the prime focus will be on the following components. a) ASP.NET b) Disconnected Data Access c) ADO.NET Architecture d) Data Access in VS.NET e) ADO.NET Data Adapters and Data Sets f) Distributed applications and Data Integration g) Filtering and Sorting in ADO.NET DataSets h) Relationships in ADO.NET DataSets i) Real-time Data Bases j) XML schemas and Data k) Concurrency issues l) Control Updates 2.6 Experimentation Simulating a model based on a mechanism for concurrency and control updates will be done to make sure that complete and consistent results are obtained and all the non- functional requirements are satisfied. Experimentation is a very important feature of the Project as it will be done on frequent basis to increase the performance level in adverse circumstances. The simulation model will be checked against the problems which arise in control update problems stating the ambiguities and conflicts which are generated when docsity.com 22 particular order of data manipulation i.e. insertion, deletion and update is followed for the original data source as the changes were made in the ADO.NET object Dataset. The simulation model for concurrency will be checked for the conflicts and problems which occur when concurrent users try to change the data at the same interval. Following cases need to be monitored where  An update is made for a record which has been deleted  Effect of one user’s modification may have adverse effect on other user’s changes or modifications. This will be done making sure that no extra load on server is kept in order to maintain additional information about the DataSet object. Also it is ensured that optimum system resources are utilized. In Experimentation, Spiral model whose diagram is given in figure 8 [10], will be utilized which states “The spiral development model is a risk driven process model generator that is used to guide multi-stakeholder concurrent engineering of software intensive systems. It has two main distinguishing features. On is a cyclic approach for incrementally growing a system’s degree of definition and implementation while decreasing its degree of risk. The other is a set of anchor point milestones for ensuring stakeholder commitment to feasible and manually satisfactory system solutions [4].” Characteristics of Spiral Model a) High amount of Risk analysis b) Unlike other process models that end when software is delivered, the spiral model can be apply throughout the life of the computer software. c) Spiral model is a realistic approach to the development of large-scale systems and software. Because software evolves as the project process progresses, the developer and customer better understand and react to risks at each evolutionary level. d) It allows reworks of earlier stages as more attractive alternatives are identified. docsity.com 25 deleted, another user deletes that record, than the first user will not be able to delete the record. Figure 10: Data Manipulation anomalies (case 2) i) If one user wants to update a record, now before the record is updated another user deletes that record, than first user will not be able to update the record. j) In concurrent user environment if three users try to perform modification operation on some record as described in figure 11, than only that user which gets access to that record first will be able to modify that record. update operation delete operation Record User 1 User 2 delete operation User 1 docsity.com 26 Figure 11: Data Manipulation anomalies (case 3) Phases of Spiral Model a) Requirements capturing b) Analysis and design c) Coding and unit testing d) Integration and testing e) Acceptance testing f) Implementation g) Deployment 2.7 Assumptions and Dependencies The assumptions and dependencies for the developed mechanism will be Visual Studio.NET should be installed on the user machine. modification operation Record User 1 User 2 User 3 modification operation modification operation docsity.com 27 The environment in which this mechanism is to developed must have local network on which all the machines will be linked. Internet Information Services (web server) will also be required. 3 Requirements Specifications 3.1 Functional Requirements 3.1.1 A connection with the data source is established To access the Database, a connection with the data source must be established. The connection with the data source is essential so that first to provide locally cached copies of data which are held in data source. Afterwards that cached data can be manipulated or deleted when even when no connection with the data source is available. Secondly the connection with the data source is important so that the changes made to the cached data can be updated in the data source. 3.1.2 A sample Database is created A sample Database will be created which will comprise of the records on which the data manipulation and retrieval operations will be performed by the users in order to determine that whether the developed mechanism fully controls the problems which occur in concurrent data access scenario or when different data manipulation operations are performed on records in different order. 3.1.3 A DataSet is created ADO.NET object “DataSet” must be created to ensure that a live connection with the data source is not being established. A dataset will not be tied to a data source but it will be containing tables or the relations between those tables. Modifications to those tables can be done by querying against DataSet and those changes will not be made in the data source which allows the DataSet to operate in a completely disconnected manner. docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved