350 likes | 461 Views
Advanced Vision Application in 3 Tiers. ActiveX DLL (COM DLL). ActiveX DLL (COM DLL). Vb app.exe. Data Object 1. Bus Object 1. Vb app.exe. Data Object 2. Bus Object 2. Data Object 3. Bus Object 3. web page?. Presentation Layer. Business layer. Data Layer. Three Tier Logical Model.
E N D
ActiveX DLL (COM DLL) ActiveX DLL (COM DLL) Vb app.exe Data Object 1 Bus Object 1 Vb app.exe Data Object 2 Bus Object 2 Data Object 3 Bus Object 3 web page? Presentation Layer Business layer Data Layer Three Tier Logical Model
Presentation Services provides the interface to the end user of the system Business Services takes care of business logic or business tasks, validation and computations. Data Services provides the capability and security required to retrieve, insert, update and delete data that is required by the business service
UML Class Diagram • UML (Unified Modeling Language) -- a graphical language for visualizing, specifying, constructing, and documenting software systems. • A class diagram shows • all the classes in your application • what tier each class is in • the relationships between the classes. Order Order Method1() Method2() <Get>Property 1 <Get>Property 2 <Let>Property 3 Order Class (Expanded) Order Class
Designing 3 Tier Systems • Most Important Guidelines • Presentation layer • should not contain any information or names that directly relate to the data source or data schema. • should not require a reference to ADO library • should not contain any business logic • Business layer • should contain all calculations and validation. • should not query the database directly • should not communicate directly with the user • Data layer • should not contain business logic • should not communicate directly with the user
<<Form>> frmPatient <<Class Module>> clsInsuranceData <<Class Module>> clsPatient <<Class Module>> clsPatientData <<Class Module>> clsInsurance User Services Business Services Data Services
clsPatient Properties
clsPatient Methods
clsPatient Methods Events
clsInsurance Properties Methods
clsInsurance Events
clsPatientData Properties
clsPatientData Methods
clsPatientData Methods Events
clsInsuranceData Properties Methods Events
Form Load Required Tasks • Create connection • Create patient recordset • Create insurance recordset • Set Connection String • Open the Connection • Open Patient Recordset • Open Insurance Recordset • Fill Insurance Combo box • Close Insurance Recordset • Set Sort Order • Set Form Values • DisplayRecordCount
Form Load Presentation Business Data AVB.mdb Set mobjPatient = New clsPatient clsPatientData Class_Initialize clsPatient Class_Initialize • Create Conn • Create Patient RecordSet • Set Conn String • Open Conn • Open Patient Recordset • Move First • Create clsPatient object • Create clsPatientData object • Properties return values of current record • UpdateProperties
Form Load Required Tasks • Create connection - DONE • Create patient recordset- DONE • Create insurance recordset • Set Connection String - DONE • Open the Connection- DONE • Open Patient Recordset - DONE • Open Insurance Recordset • Fill Insurance Combo box • Close Insurance Recordset • Set Sort Order • Set Form Values • DisplayRecordCount
Form Load Presentation Business Data AVB.mdb clsInsuranceData Class_Initialize Set mobjInsurance = New clsInsurance clsInsurance Class_Initialize • Create Conn • Create Insurance RecordSet • Set Conn String • Open Conn • Open Insurance Recordset • Create clsInsurance object • Create clsInsuranceData object
Form Load Required Tasks • Create connection - DONE • Create patient recordset- DONE • Create insurance recordset-DONE • Set Connection String - DONE • Open the Connection- DONE • Open Patient Recordset - DONE • Open Insurance Recordset - DONE • Fill Insurance Combo box • Close Insurance Recordset • Set Sort Order • Set Form Values • DisplayRecordCount
Form Load Presentation Business Data AVB.mdb clsInsuranceData InsuranceRecords Property mobjInsurance.GetInsuranceList Ins clsInsurance GetInsuranceList Method • Returns Insurance Recordset • Call GetInsurance List Method, Pass the array Ins to hold list • Calls GetRows method of clsInsuranceData. • InsuranceRecords • Sets ByRef array equal to result of GetRows • Fill combobox with contents of Ins Array
Form Load Required Tasks • Create connection - DONE • Create patient recordset- DONE • Create insurance recordset-DONE • Set Connection String - DONE • Open the Connection- DONE • Open Patient Recordset - DONE • Open Insurance Recordset - DONE • Fill Insurance Combo box - DONE • Close Insurance Recordset • Set Sort Order • Set Form Values • DisplayRecordCount
Form Load Presentation Business Data AVB.mdb clsInsuranceData Class_Terminate Set mobjInsurance = Nothing clsInsurance Class_Terminate • Close Insurance Recordset • Close Conn • Terminate Insurance Recordset • Terminate Connection • Terminate Insurance Object • Set mobjInsData = Nothing
Form Load Required Tasks • Create connection - DONE • Create patient recordset- DONE • Create insurance recordset-DONE • Set Connection String - DONE • Open the Connection- DONE • Open Patient Recordset - DONE • Open Insurance Recordset - DONE • Fill Insurance Combo box - DONE • Close Insurance Recordset- DONE • Set Sort Order • Set Form Values • DisplayRecordCount
Form Load Presentation Business Data AVB.mdb mobjPatient.Sort "Patient Number" clsPatientData.Sort clsPatient.Sort • Selects Field Name based on string that is passed • Calls sort method of patient recordset • Raises DataChange Event • Calls Sort Method of clsPatient • Calls Sort Method of clsPatientData mobjPatientData_DataChange() mobjPatient_PropertyChange • Properties return values of current record • UpdatesProperties • Raises Property Change Event • Assigns Form Values
Form Load Required Tasks • Create connection - DONE • Create patient recordset- DONE • Create insurance recordset-DONE • Set Connection String - DONE • Open the Connection- DONE • Open Patient Recordset - DONE • Open Insurance Recordset - DONE • Fill Insurance Combo box - DONE • Close Insurance Recordset- DONE • Set Sort Order- DONE • Set Form Values- DONE • DisplayRecordCount
Form Load Presentation Business Data AVB.mdb mobjPatient.AbsolutePosition clsPatientData.AbsolutePosition clsPatient.AbsolutePosition • mrsPatient.AbsolutePosition • Calls absolute position method of mobjPatient • Calls clsPatientData.AbsolutePosition mobjPatient.RecordCount clsPatientData.RecordCount clsPatient.RecordCount • mrsPatient. • RecordCount • Calls RecordCount Method of mobjPatient • Calls clsPatientData.RecordCount
Form Load Required Tasks • Create connection - DONE • Create patient recordset- DONE • Create insurance recordset-DONE • Set Connection String - DONE • Open the Connection- DONE • Open Patient Recordset - DONE • Open Insurance Recordset - DONE • Fill Insurance Combo box - DONE • Close Insurance Recordset- DONE • Set Sort Order- DONE • Set Form Values- DONE • DisplayRecordCount- DONE
MoveLast Required Tasks • mrsPatient.MoveLast • DisplayRecordCount • Set Form Elements
MoveLast Presentation Business Data clsPatientData.MoveLast mobjPatient.MoveLast clsPatient.MoveLast • mrsPatient.MoveLast • Raise DataChange Event • Calls MoveLast method of mobjPatient • Calls clsPatientData.MoveLast AVB.mdb mobjPatientData_DataChange() mobjPatient_PropertyChange • Properties return values of current record • UpdatesProperties • Raises Property Change Event • Assigns Form Values
Delete Required Tasks • Create Command object • Set Connection String • Set Command String • Execute Command • Requery Recordset • Check to see if deleted last record • Update form elements
Delete Presentation Business Data clsPatientData.Delete mobjPatient.Delete clsPatient.Delete • Creates Command • Sets Conn • Sets Command Text • Executes • Requeries • Raises DataChange Event • Calls Delete method of mobjPatient • Calls clsPatientData.Delete (passes Patient ID) AVB.mdb mobjPatient_PropertyChange mobjPatientData_DataChange() • Properties return values of current record • Assigns Form Values • UpdatesProperties • Raises Property Change Event
Form Unload Required Tasks • Close Patient RecordSet • Close Connection • Set Recordset = nothing • Set Connection = nothing
Form Unload Presentation Business Data Set mobjPatient = Nothing clsPatientData class_Terminate clsPatient Class_Terminate • Set mobjPatient to Nothing • Set mobjPatientData= Nothing • Close Recordset • Close Conn • Set RS = nothing • Set Conn = nothing AVB.mdb