260 likes | 380 Views
DAT602 Database Application Development. Lecture 12 C/S Model Database Application. Database Application Development - Lecture 12. In this lecture, you will see how to create a simple Client / Server model database application.
E N D
DAT602 Database Application Development Lecture 12 C/S Model Database Application
Database Application Development - Lecture 12 • In this lecture, you will see how to create a simple Client / Server model database application. • We will build a simple library book management system for demonstration.
Database Application Development - Lecture 12 • There are basically two major kinds of modern architectures: two-tier client/server and three-tier—also commonly called n-tier.
Database Application Development - Lecture 12 • Two-tier client/server A two-tier application ideally provides multiple workstations with a uniform presentation layer that communicates with a centralized data storage layer. The presentation layer is generally the client, and the data storage layer is the server.
Database Application Development - Lecture 12 Two-tier client/server • Following diagram shows how two-tier systems give clients access to centralized data.
Database Application Development - Lecture 12 • Two-tier limitations - Fat clients Two-tier, fat-client systems are notorious for their inability to adapt to changing environments and scale with growing user and data volume. Even though a client's primary task is the presentation of data, a fat client is loaded with knowledge completely unrelated to that task.
Database Application Development - Lecture 12 • Two-tier limitations - Object reuse In one common sense, object reuse is simply code reuse. In two-tier model, code is too close to database server, it is not easy to be modified when business logic changes. Two-tier model lacks flexibility.
Database Application Development - Lecture 12 • When to use a two-tier design? If you can answer "yes" to each of the questions in the checklist, then a two-tier architecture is likely your best solution. - Does your application emphasize time-to-market over architecture? - Does your application use a single database? - Is your database engine located on a single host? - Is your database likely to stay approximately the same size over time? - Is your user base likely to stay approximately the same size over time? - Are your requirements fixed with little or no possibility of change? - Do you expect minimal maintenance after you deliver the application?
Database Application Development - Lecture 12 • Three-tier’s advantage - Isolated database connectivity Three-tier model helps you to split presentation layer and data storage layer. Changes of these two layers won’t affect each other.
Database Application Development - Lecture 12 • Three-tier’s advantage - Centralized business processing These centralized rules for processing data inside business objects are called business rules . No matter what your problem domain is, the rules for how data should be processed rarely change.
Database Application Development - Lecture 12 • Three-tier’s advantage - Business object presentation The presentation layer of a three-tier application should therefore contain only user interface code that can be modified easily on a whim. The presentation layer of a bank application: • The teller window's console at the bank • The ATM machine • The web applet
Database Application Development - Lecture 12 • Drawbacks to the three-tier architecture Chief among its drawbacks is the level of complexity it adds to a system. It is also harder to find software engineers who are competent in three-tier programming skills such as transaction management and security.
Database Application Development - Lecture 12 • In next, I’ll give you a demonstration for how to create a simple two-tie client server database application. • This C/S database application is developed for library management.
Database Application Development - Lecture 12 Step 1: write your specification of this library application. What kind of users be involved in this application? What features this application should has? Simple hierarchy of your application.
Database Application Development - Lecture 12 Extremely Simple Specification • In this application, there are two kinds of users: librarian and normal user. • Librarians has fully authorization, they can add, modify or remove books, users information, and also can add or modify loan log. • Normal users can observe their loan log and check their accounts’ status. • This application should consists with two client GUIs, one for librarians, and another for normal users.
Database Application Development - Lecture 12 Step: 2 Design and build database of this library application. Diagram: Structure of library application
Database Application Development - Lecture 12 • Step 3: implement basic operation: insert record, remove record, query for each table. • Step 4: Design GUI