Three-story development basic concept introduction

zhaozj2021-02-08  234

Three-layer client / server

One: Advantages: flexibility and scalability.

Application of three-story development technology (distributed)

(Reference book: Delphi 5.x distributed multi-layer application system)

One: Solve the maintenance cost problem of client / server structure, improve client / server structural ductility issues.

The number of users supported by the client / server structure has a certain limit (less than 200 people). The structure limits the development of Internet / Intranet and e-commerce. Three-layer development application Database Pooling, Object Pooling, Resource Pool, thread mode provides high ductility.

Two: Solve the problem of application logic reuse.

For example, when enterprises want to add a web browsing service on the original client / server structure, you need to configure the web server, rewrite all application logic, and update the MIS system. In the three-layer structure, use COM / DCOM, CORBA (Common Object Request Broker Architecture), or Enterprise Java Bean, etc., packaged company's logic code (called corporate object), can solve the above problems. It greatly reduces the cost of development and maintenance.

Three: Integrate the needs of different system structures, and apply new technologies in time.

Two: Three-layer service model of Microsoft

1: Structure: It is a tool for Windows DNA (Distributed Internet Applications, Distributed Internal Network) COM (Component Object Model, Component Object Object Model) Components as tools for implementing system and application services.

l User service

l Business service

l Data service

(1) User Service: Windows DNA defines four customers that can be used to implement user service layers:

N standard Browse customers: Depending on the simple, page-based HTML management data representation and interact with the user. Its compatibility is very good and the function is not rich.

n Enhanced Browser Customer: Draw a special browser (EX: Dynamic HTML, script, and ActiveX control) to maximize the richness and functionality of the user interface, which is suitable for company intranet.

N-dependent Internet Customer: You can integrate access to the Internet and access to the operating system on the client machine.

N Enhanced Internet Customers: Microsoft Office 97 and Microsoft Visual Studio.

(2) Business services: Integrate the server-based Microsoft product with custom COM components to operate in one piece.

N Web Services (Microfsoft Internet Information Server and Active Server Pages).

N Transactions and Components Services (Microsoft Transaction Server and COM).

N Message Service (Microsoft Message Queue Server).

N General Data Access (Microsoft Data Accessible)

l Interoperability of the mainframe environment (Microsoft SNA server). The details are listed in the topic below.

(3) Data services:

n Microsoft SQL Server7 Database.

N Microsoft Exchange Server 5.5 version of the directory and information library.

Topic:

Business service

One: Web Services (Microsoft Internet Information Server and Active Server Pages).

Web service object model:

1. Server object: Provide access to the method and attribute on the server. Example: AsAL Data Access (Microsoft Data Access) SetObjMyObject = Server.createObject ("BusinessServer.MyruleObject") 2: Session object: Used to store one Information necessary for a particular user session.

3: Application object: Used to make all users of an application share interests.

4: REQUEST object:.

5: Response object:.

2: Transactions and Components (Microsoft Transaction Server and COM)

1: Microsoft Transaction Server (MTS) is a component-based transaction system to meet complex transactions. MTS supports SQL Server and

What is the database of the XA protocol of the X / Open algorithm (see note).

The services provided by MTS are:

n Support for distributed transactions.

n Services for controlling instantiation and use of objects.

Automatic management of n processes and threads.

N object instance management.

n Database Connection Management (Connection Pool).

In the application, the corresponding components can be declared completion of the above services.

2: MTS and SQL Server transactions, require atomic execution, or throughout success, the entire failure. Transaction Server and Microsoft Distributed Transaction Coordinator (MSDTC) Interaction Confirmation The transaction meets the ACID (atomic Atomicity, consistency consistency, separation isolatation, and durability durability).

3: The difference between MTS and SQL Server transactions. MTS can be implemented with Visual Basic, Visual C and other packaged MTS components, Recordset pair

Add a new line of addNew methods. The SQL Server transaction can only be written by Transact-SQL code, such as (ADO).

4: Windows DNA (Windows Distributed Internet Application Architecture): Develops Customer / Services Mode with Web and the Strategy.

Using HTML, DHTML, Active Server Pages provides users with a first layer (expression layer), MTS, and MTS components such as IIS (Internet Information Server), IIS / ASP components, and ASP scripts (business logic layers), SQL Server as the data service layer.

5: MTS uses the Distributed Transaction Coordinator, DTC) Transaction Engine. DTC uses two segment delivery standards.

Information about DTC can be obtained by using MMC (Microsoft Management Console) Open C: /Winnt/System32/Services.msc,

Locate the DTC service in the list on the right and look at its properties.

6: Use MTS to maximize system performance. (Precautions)

n Avoid pass or return to an object.

n Use the value (BY VAL) to pass the parameters. (BY VAL keyword minimizes the network room)

n Avoid creating a database cursor. Use less RECORDSET objects.

n By making the object package container threaded, MTS can perform concurrent customer requests in multiple objects.

7:

Note: XA is a two-phase submission protocol defined by the X / Open organization that allows transactions during multiple database services to be coordinated, and it is a transaction. (UNIX database, including Oracle, Informix, DB2 support)

Three: Message Service (Microsoft Message Queue Server).

1: Microsoft Message Queue (MSMQ) provides an asynchronous communication function for the application. MSMQ is considered to be a bridge in the connection distributed application. 2: MSMQ automatically integrate with MTS. The application can encapsulate the MSMQ message in the MTS transaction.

3: MSMQ and the different Microsoft Exchange servers. Person -to-Person's messaging.

4: Universal Data Access (Microsoft Data Access Member)

The data access component spans the boundaries between the business service layer and the data service layer. ADO, OLE DB (Embedded Database), and ODBC together form a Microsoft Data Access Configuration (MDAC).

5: Interoperability of large machine environments (Microsoft SNA server)

Microsoft COM & DCOM (Introduction)

One: COM is a protocol that defines how the object server interacts with the object customer. Object Server is a module that implements COM classes. Object Consumer is a module that uses COM objects.

DCOM extends the COM protocol, making the object server can be located in a computer different from the customer. Call the object server via the RPC. (CORBA is also a distributed object protocol)

COM manages the security of the object via SSPI (Security Support Provider Interface, Security Support Provider).

Second: Application Server (Intermediate Layer) The characteristics:

n Distance start, monitoring, and abort.

n Scalable ability.

N is easy to configure.

n Security failure.

Far-level startup function: If the user wants to create a COM object on the remote computer, the DCOM Service Control Manager (SCM) on the remote computer will automatically start the COM server and make the COM object. The specific information can run the DCMCNFG command in the Start menu.

Easy to configure the ability: Right-click on a COM DLL or EXE in the Windows Explorer to activate registration or revoking registration.

Scalable capabilities: scalable first level and second level. Two load balancing provided by DCOM. 1), static load balancing (specifying the running machine of the application server), specified in the properties of the application in the DCMCNFG. 2): Dynamic load balancing, allocated by the scheduler.

Delphi provides related technologies:

u COM / DCOM / COM business object.

u Corba business object.

u xml / html

U CGI / SAPI / NSAPI

u ASP

u Active X (Active Form)

U ADO / OLE DB

U BDE / IDAPI SQL LINKS

U MTS object

u Midas server

u CORBA server.

Related components in 1) File menu / New / Multitier and ActiveX pages.

2) ADO, MIDAS, Internet Express, ActiveX and other pages in the component panel.

Introduction to CORBA

1: What is CORBA (Common Object Request Broker Architecture)?

CORBA is a distributed object standard structure defined by Object Management Group (OMG). Language neutral, using object-oriented design structure, allowing software objects to be reused in different operating system platforms and applications.

If you want to implement a function, CORBA is a better solution: l Application system To integrate heterogeneous platforms and operating systems.

l The application server must be executed in the Linux / UNIX machine.

l The application system must perform a critical task, with secure powerful fault tolerance, must be stable and efficient.

l To develop Internet / IntraNet solutions using web objects.

l Application system future wants to integrate with Java.

2: The structure of CORBA

The CORBA object is a component that provides a specific service that declares the available services by defining a set of output interfaces. In this output interface, the CORBA object defines the methods and access properties that the client can call. The client only indicates the name of the CORBA object that provides the service, and the method to be called or

Access properties You can get a CORBA objects via ORB.

Terminology:

ORB: Object Request Broker. Joint the client and intermediary CORB object.

Stub object: Run the replica of the CORBA object of the client, call the Stub object on the client, then the Stub object is called via ORB remote call

Corba objects, STUB objects with Marshaling (object pointer conversion, enable the other party to identify) automatically transfer parameters and data.

Skeleton object: Objects running on the server, restore the data passed to the server into the server side using the format. The CORBA object is then called according to the automatic requirements according to the client.

Call mode:

u Static call: The client program passes the data to the CORBA object via the Stub object, and the CORBA object is executed, through the Skeleton object.

Return the result marshaling back to the client's Stub object, and then return to the client's application after replying to the data format via the Stub object.

Dynamic Interface Invocation DII: The client does not need to have a Stub object, nor does it need to know the methods and properties provided by the remote CORBA object, and the CORBA program can get this information when executed, and then dynamically call the CORBA object.

DII has a greater elasticity than static calls, but the programming is difficult, and the performance efficiency is not as static.

3: Core service provided by CORBA

N Event Service: The "Provider-Consumers (Supplier_Consumer) model passes an event to the consumer object in asynchronously through an event signal.

n Naming Service: Allow programmers to use class-type ways to name the business object, and then use these meaningful names in the program to access these objects.

n Transaction Service: Provides a distributed application to perform a critical task, allowing business objects to transaction management between the heterogeneous platform and the database data.

N Security Service: Access Control, Auding, Authentication, Access Policy Control (PLICY CONTROL).

Midas introduction

One: Midas Concept

MIDAS (Multi-Tier Distrib-Application Services Suite) is an intermediary transparent engine for developing multi-layer applications. With MIDAS, programmers can access different backend application servers (such as COM / DCOM application servers, CORBA application servers, MTS intermediary software) through the same components, and Midas also provides fault tolerance, load balancing, and high execution. The ability to efficiency.

Intermediaries and features: U Remote Data Broker: Provides the ability to access client access.

u Constraint intermediaries: Allow client applications to download remote databases for Constraint settings for data. Let the data check on the client by the database's construint. Reduce network traffic.

u Enterprise Object Broker: Allows the application to develop corporate objects that perform corporate logic.

U fault tolerance: When a client-connected application server error occurs, the business object intermediaries will find another application server that provides the same functionality in the network, link the client to the application server, customers and I don't know everything that happens. At this time, there must be a stateless object.

u Load Balancing: When the client is more than the number of servers, the number of enterprise objects automatically balance the number of connections of the server.

Two: Data processing

The application server removes the data you want from the database, and the data packet is performed, passed to the client through the Iappserver interface. After arrival, the client's Midasserver is organized, add the data fast storage memory of the clientDataSet. In this case, the client is disconnected by the connection of the application server.

When the client applies the ApplyUpdates method for the TclientDataSet to be updated, Midasserver packages the updated data package in the data packet, and then package the updated data (only changed), when the application server receives these Delta data packets After that, Resolver first analyzes it.

Then for each updated data, Resolver first looks for records in the database in the database, if the record has been changed by other users, Midas will put the latest clients and databases in the database. The pen data is transmitted back to the client, requiring the user to decide how to handle it.

If the data update fails, the MIDAS will pick up the problematic data into the data package.

转载请注明原文地址:https://www.9cbs.com/read-2624.html

New Post(0)