Object-Oriented Application Development Using VB.NET 1 Chapter 15 Assembling a Three-Tier Windows Application.

Slides:



Advertisements
Similar presentations
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Advertisements

Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
Systems Analysis and Design in a Changing World, Fourth Edition
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
1 Chapter 12 Working With Access 2000 on the Internet.
Object Oriented System Development with VB .NET
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Object-Oriented Application Development Using VB.NET 1 Chapter 13 Introduction to Data Access Classes and Persistence.
Object-Oriented Application Development Using VB.NET 1 Creating a String Array Code to create a String array: ' declare a String array with 4 elements.
11 3 / 12 CHAPTER Databases MIS105 Lec14 Irfan Ahmed Ilyas.
Concepts of Database Management Sixth Edition
Chapter 4: Database Management. Databases Before the Use of Computers Data kept in books, ledgers, card files, folders, and file cabinets Long response.
Object-Oriented Application Development Using VB.NET 1 Chapter 7 Adding Responsibilities to Problem Domain Classes.
Chapter 13: Advanced GUI and Graphics
ASP.NET Programming with C# and SQL Server First Edition
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
1 A Student Guide to Object- Orientated Development Chapter 9 Design.
Object-Oriented Application Development Using VB.NET 1 Chapter 9 Implementing Association Relationships.
Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
CS708 Fall 2004 Professor Douglas Moody –MW – 2:15-3:55 pm –Friday – 6:00-9:20 pm – – –Web Site: websupport1.citytech.cuny.edu.
Chapter 15 - Creating More Complex Database Applications 1 Chapter 15 Creating More Complex Database Applications.
The chapter will address the following questions:
ADVANCED MICROSOFT ACTIVE DIRECTORY CONCEPTS
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
The Design Discipline.
Systems Analysis and Design in a Changing World, Fifth Edition
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Database Programming in Java Corresponds with Chapter 32, 33.
An Object-Oriented Approach to Programming Logic and Design
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Chapter 8: Writing Graphical User Interfaces
2. Database System Concepts and Architecture
Systems Analysis and Design in a Changing World, 6th Edition
12 Systems Analysis and Design in a Changing World, Fifth Edition.
1 ITEC 3010 “Systems Analysis and Design, I” LECTURE 10: Use Case Realizations [Prof. Peter Khaiter]
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Systems Analysis and Design in a Changing World, 3rd Edition
Chapter 14 - Designing Data Access Classes1 Chapter 14 Designing Data Access Classes.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
Chapter 12 - Designing Multiwindow Applications1 Chapter 12 Designing Multiwindow Applications 12.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
Object-Oriented Application Development Using VB.NET 1 Chapter 6 Writing a Problem Domain Class Definition.
Object-Oriented Application Development Using VB.NET 1 Chapter 6 Writing a Problem Domain Class Definition.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Microsoft Visual Basic 2012 CHAPTER ELEVEN Multiple Classes and Inheritance.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Access Chapter 1: Intro to Access Objectives Navigate among objects in Access database Difference between working in storage and memory Good database file.
Chapter 11 - A GUI Interacting With a Problem Domain Class1 Chapter 11 A GUI Interacting With a Problem Domain Class 11.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Juanita Cano City of Sacramento Spring 2014 Geography 375.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Object-Oriented Application Development Using VB.NET 1 Chapter 9 Implementing Association Relationships.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
Object-Oriented Application Development Using VB.NET 1 Chapter 11 Using Multiple Forms with Problem Domain Classes.
Object-Oriented Application Development Using VB.NET 1 Chapter 13 Introduction to Data Access Classes and Persistence.
11. Chapter 11: The Object-Oriented Approach to Design: Use Case Realization Systems Analysis and Design in a Changing World, Fourth Edition.
Understand Data Definition Language (DDL) Database Administration Fundamentals LESSON 1.4.
Visual Basic 2010 How to Program
© 2016, Mike Murach & Associates, Inc.
IS444: Modern tools for applications development
IS444: Modern tools for applications development
Creating More Complex Database Applications
Presentation transcript:

Object-Oriented Application Development Using VB.NET 1 Chapter 15 Assembling a Three-Tier Windows Application

Object-Oriented Application Development Using VB.NET 2 Objectives In this chapter, you will: Review three-tier design Combine a problem domain class, a data access class, and a GUI Use multiple GUIs and add an instance to a database Use GUIs with multiple problem domain classes to interact with a database

Object-Oriented Application Development Using VB.NET 3 Reviewing Three-Tier Design Three-tier design –An architecture for structuring OO applications –The three tiers GUI classes Problem domain classes Data access classes

Object-Oriented Application Development Using VB.NET 4 Reviewing Three-Tier Design In three-tier design –User interacts with GUI class instances –GUI instances interact with problem domain classes and instances –Problem domain classes and instances interact with data access classes –Data access classes handle storing and retrieving data from files or databases

Object-Oriented Application Development Using VB.NET 5 Reviewing Three-Tier Design

Object-Oriented Application Development Using VB.NET 6 Reviewing Three-Tier Design Benefits of three-tier design –System maintenance is simplified –Applications can be distributed across the network Three-tier design lends itself to client-server architectures

Object-Oriented Application Development Using VB.NET 7 Three-Tier Design and the Development Process OO system development is done iteratively –Some analysis, some design, and some implementation occurring before continuing with more analysis, more design, and more implementation

Object-Oriented Application Development Using VB.NET 8 Three-Tier Design and the Development Process OO system analysis –Define the requirements for the system Use cases –Each use case is expanded into multiple scenarios »Scenarios define the functions the system provides Problem domain classes –Initially defined in terms of »Attributes »A few key methods –Additional details are added during each iteration

Object-Oriented Application Development Using VB.NET 9 Three-Tier Design and the Development Process OO system design –Add details that specify how the system will be physically implemented –Examples User interface design Physical design of the database OO system implementation –Write code to define Problem domain classes GUI classes Data access classes

Object-Oriented Application Development Using VB.NET 10 Three-Tier Design and the Development Process

Object-Oriented Application Development Using VB.NET 11 Combining a PD class, a DA class, and a GUI First three-tier example –Involves Customer problem domain class from Chapter 13 Customer data access class from Chapter 13 FindCustomer GUI from Chapter 11 –FindCustomer GUI retrieves information about a specific customer

Object-Oriented Application Development Using VB.NET 12 Combining a PD class, a DA class, and a GUI

Object-Oriented Application Development Using VB.NET 13 Reviewing the Customer Problem Domain Class Customer problem domain class from Chapter 13 –Used by this example –Includes Four class methods –Initialize –Terminate –GetAll –Find Three instance methods –AddNew –Update –Delete

Object-Oriented Application Development Using VB.NET 14 Reviewing the Customer Problem Domain Class Customer problem domain class from Chapter 13 (continued) –DA methods pass requests to the CustomerDA class, when invoked

Object-Oriented Application Development Using VB.NET 15 Reviewing the Customer Data Access Class CustomerDA class –Implements the details associated with the data access methods in the Customer class –Throws exceptions if A new customer already exists A customer that is to be deleted or updated cannot be found

Object-Oriented Application Development Using VB.NET 16 Reviewing the Customer Data Access Class CustomerDA class from Chapter 13 –Requires no changes for use in this three-tier example –A modification done for convenience The database file (CustomerDatabase.mdb) is placed within the project’s bin folder –Enables the removal of the hard-coded path to the data source from the code

Object-Oriented Application Development Using VB.NET 17 Updating the FindCustomer GUI FindCustomer GUI –Introduced in Chapter 11, Example 4 –Used for the final tier of this example –Requires only a few minor modifications to work with the Customer and CustomerDA classes

Object-Oriented Application Development Using VB.NET 18 Updating the FindCustomer GUI Required modifications –Constructor Must initialize the database –Reason: This example does not include a MainMenu GUI –PopulateListBox method Invokes the GetAll method of the Customer class –To retrieve customer instances from the database for populating the list box

Object-Oriented Application Development Using VB.NET 19 Updating the FindCustomer GUI Required modifications (continued) –btnUpdate_Click method Invokes the Update method of the Customer class –To update customer information in the database The Enabled property of the CustomerPhone text box is set to False –Reason: Customer phone number is the primary key for the customer table

Object-Oriented Application Development Using VB.NET 20 Updating the FindCustomer GUI

Object-Oriented Application Development Using VB.NET 21 Updating the FindCustomer GUI Required modifications (continued) –btnClose_Click method Terminates the connection to the database –Reason: This example does not include a main menu GUI

Object-Oriented Application Development Using VB.NET 22 Using Multiple GUIs and Adding an Instance to the Database Second three-tier example –Uses multiple GUIs –Adds an instance to the database using a data access class –Based on Example 4 in Chapter 11 –Contains a main menu, which allows the user to Find a customer Add a new customer

Object-Oriented Application Development Using VB.NET 23 Using Multiple GUIs and Adding an Instance to the Database Classes involved –FindCustomer GUI from previous example in this chapter Modified slightly to work with the main menu –AddCustomer GUI from Chapter 11 Modified slightly to work with the data access classes –MainMenu GUI from Chapter 11 Modified slightly to work with the data access classes

Object-Oriented Application Development Using VB.NET 24 Using Multiple GUIs and Adding an Instance to the Database Classes involved (continued) –Custom exceptions NotFoundException DuplicateException –Customer class defined in the previous example Does not have to be modified –CustomerDA class defined in the previous example Does not have to be modified

Object-Oriented Application Development Using VB.NET 25 Using Multiple GUIs and Adding an Instance to the Database

Object-Oriented Application Development Using VB.NET 26 Reviewing the MainMenu GUI MainMenu GUI class of Chapter 11 –Only two minor changes are needed for this example Invokes the Initialize method of the Customer class –To establish the connection to the database Invokes the Terminate method of the Customer class –To terminate the connection to the database

Object-Oriented Application Development Using VB.NET 27 Reviewing the AddCustomer GUI AddCustomer GUI –First introduced in Chapter 11 –Modifications for this example btnAdd_Click method –Invokes the AddNew method of the Customer class (rather than the CustomerData class) »Allows AddCustomer to work with data access classes

Object-Oriented Application Development Using VB.NET 28 Updating the FindCustomer GUI FindCustomer GUI class used in the previous example –Modifications required for this example The statement that invokes the Initialize method is removed –In this example, the MainMenu GUI establishes the connection to the database The statement that invokes the Terminate method is removed –In this example, the MainMenu GUI terminates the connection to the database

Object-Oriented Application Development Using VB.NET 29 Using GUIs with Multiple Problem Domain Classes Third three-tier example –Combines multiple GUIs with multiple problem domain and data access classes –Contains GUIs seen in this chapter and in Chapter 11 –MainMenu –FindCustomer –AddCustomer –AddBoat

Object-Oriented Application Development Using VB.NET 30 Using GUIs with Multiple Problem Domain Classes Third three-tier example –Contains (continued) Classes from Chapter 14 –Customer –CustomerDA –Boat –BoatDA –CustomerAndBoatDatabaseConnect

Object-Oriented Application Development Using VB.NET 31 Using GUIs with Multiple Problem Domain Classes

Object-Oriented Application Development Using VB.NET 32 Reviewing the Customer and Boat PD and DA Classes From Chapter 14 This example uses the chapter 14 versions of the following classes without modifications –Customer problem domain class –Customer data access class –Boat problem domain class –Boat data access class –CustomerAndBoatDatabaseConnect class

Object-Oriented Application Development Using VB.NET 33 Reviewing the Customer and Boat PD and DA Classes From Chapter 14 Association relationship between Customer and Boat –Multiplicity: one-to-one in both directions –Established by including A Boat reference variable in Customer A Customer reference variable in Boat Accessor methods for the Boat and Customer references

Object-Oriented Application Development Using VB.NET 34 Reviewing the Customer and Boat PD and DA Classes From Chapter 14 CustomerAndBoatDatabase.mdb from Chapter 14 –A relational database –Includes two tables: CustomerTable BoatTable –Foreign key: CustomerPhoneNo »Allows the two tables to be joined –Used without modifications in this example

Object-Oriented Application Development Using VB.NET 35 Modifying the MainMenu GUI MainMenu GUI –Opens and closes the connection to the database –Constructor Invokes the Initialize method of the CustomerAndBoatDatabaseConnect class –To establish the common connection Shares this connection by passing it to the Initialize methods of –Customer class –Boat class

Object-Oriented Application Development Using VB.NET 36 Modifying the MainMenu GUI MainMenu GUI (continued) –btnClose_Click procedure Closes the connection to the database

Object-Oriented Application Development Using VB.NET 37 Modifying the FindCustomer GUI FindCustomer GUI from the previous example –Modifications required for this example A Boat reference variable is included in the class definition –Reason: FindCustomer must now recognize the association between Customer and Boat lblBoatInfo label is added to the btnFind_Click method –lblBoatInfo label holds information about the customer’s boat

Object-Oriented Application Development Using VB.NET 38 Reviewing the AddCustomer GUI from Chapter 11 AddCustomer GUI presented in Chapter 11 –Used without modifications in this example –Validates customer information entered by the user –Creates a corresponding instance of Customer –Passes the newly created Customer instance to the AddBoat GUI as an argument AddBoat GUI –Captures information about the customer’s boat –Adds the customer information to CustomerTable –Adds the boat information to BoatTable

Object-Oriented Application Development Using VB.NET 39 Modifying the AddBoat GUI AddBoat GUI from chapter 11 –Constructor: receives a Customer reference variable in the parameter list –Validates the boat information entered by the user –Creates a corresponding instance of Boat –Establishes the two-way association between the customer and boat instances

Object-Oriented Application Development Using VB.NET 40 Modifying the AddBoat GUI In this three-tier example, AddBoat must now –Add the boat record to BoatTable –Add the associated customer record to CustomerTable

Object-Oriented Application Development Using VB.NET 41 Modifying the AddBoat GUI Modifications needed for this example –AddSailboat method Creates an instance of the Boat class, rather than an instance of Sailboat Invokes the AssignBoatToCustomer method of the Boat class –AddPowerboat method Creates an instance of the Boat class, rather than an instance of Powerboat Invokes the AssignBoatToCustomer method of the Boat class

Object-Oriented Application Development Using VB.NET 42 Summary Three-tier design is a strategy for creating OO applications that are easy to maintain Three-tier design provides a framework that lends itself to iterative development In iterative development, some analysis, some design, and some implementation are completed and then the process repeats with more analysis, more design, and more implementation

Object-Oriented Application Development Using VB.NET 43 Summary First example: demonstrated one GUI, one PD class, one DA class, and a database with one table Second example: used multiple GUIs (including MainMenu, AddCustomer, and FindCustomer), one PD class and one DA class Third example: used multiple GUIs, two PD classes with an association relationship, two DA classes, and a database with two tables