Bài giảng Kiến trúc phần mềm - Chương: Mẫu thiết kế Middleware - Trần Minh Triết

Trường Đại học Khoa Học Tự Nhiên  
Khoa Công Nghệ Thông Tin  
Bộ môn Công Nghệ Phần Mềm  
CTT526 - Kiến trúc phần mềm  
Middleware  
PGS.TS. Trần Minh Triết  
Version 1.0  
Nội dung của bài giảng sử dụng:  
Session 4:  
A Guide to Middleware Architectures and Technologies  
trong bộ slide Software Architecture Essential  
của GS. Ian Gorton  
Software Engineering Institute  
Carnegie Mellon University  
2
Introduction  
Middleware is the plumbing or wiring of IT  
applications  
Provides applications with fundamental services for  
distributed computing  
Insulates applications from underlying platform  
(OS, DBMS, etc) APIs  
Lots of middleware exists  
Different purposes  
Different v
Different standards and proprietary technologies  
3
Middleware Classification  
BizTalk, TIBCO StaffWare, ActiveBPEL  
Business Process Orchestrators  
BizTalk, WebSphere Message Broker, SonicMQ  
Message Brokers  
Application Servers  
Transport  
J2EE, CCM, .NET  
Message-Oriented Middleware, Distributed Objects Systems  
4
Outline  
CORBA  
Message-oriented middleware  
J2EE  
Message brokers  
Business process orchestrators  
5
CORBA  
Venerable distributed object technology  
Still widely used in telecomms, defense  
Many different implementations  
Client  
Object Reference  
Server  
Servant  
request  
reply  
client ORB  
server ORB  
Network  
6
CORBA Code Example  
module ServerExample  
{
CORBA IDL  
interface MyObject {  
};  
string isAlive(); };  
class MyServant extends _MyObjectImplBase  
n "\nLooks like it…\n"; }  
}
Server  
ORB orb = ORB.init(args, null);  
MyServant objRef = new MyServant();  
orb.connect(objRef);  
ORB orb = ORB.init(args, null);  
Client  
// Lookup is a wrapper that actually access the CORBA Naming  
// Service directory – details omitted for simplicity  
MyServant servantRef = lookup(“Myservant”)String  
reply = servantRef.isAlive();  
7
CORBA – Some Thoughts  
Many associated services, eg  
Naming  
Notification  
Transactions  
Synchronous technology, client-server relatively tightly  
coupled  
Remote calls can/will fail  
State management in server objects creates  
„interesting‟ recovery issues  
8
Messaging - MOM  
Basic Message Oriented Middleware (MOM) provides  
features like:  
Asynchronous communications between processes,  
applications and systems  
Send-and-forget  
Delivering messages despite failures  
Transactional Messaging  
Deliver all messages in a transaction, or none  
Persistence  
Messages can be logged at the server and hence  
survive server failure  
9
Basic Messaging  
Send (queue, message)  
Put message onto queue  
Receive (queue, message)  
Get message from queue  
No dependency on state of receiving  
application on message send  
end  
eee  
queue  
10  
Persistence  
queue  
send  
receive  
Receipt of message at queue implies  
message is written to disk log  
Removal of message from queue  
deletes message from disk log  
Trade-off performance versus reliability  
11  
MOM Server  
Receivers  
Senders  
Message  
Handler Thread Pool  
Peer-to-peer MOM technologies are the alternative design  
12  
MOM Transactions  
Begin transaction  
Begin transaction  
...  
...  
update database record  
put message on queue  
...  
get message from queue  
update database record  
...  
commit transa
nsaction  
13  
MOM Transactions  
Sender and receiver do *not* share a transaction  
Rollback on receiver does not affect the sender (already  
committed)  
„Synchronous‟ operations are not atomic  
Request/response is 3 transactions not 1  
. Put to
. Get from request queue, put to response queue  
. Get from response queue  
Request queue  
send  
receive  
send  
receive  
Response queue  
14  
Scaling MOM  
MOM Server  
ApplicationQ  
Senders  
Receivers  
MOM Server  
ApplicationQ  
15  
Messaging – Some thoughts  
Highly attractive asynchronous technology  
Supports loosely-coupled, dynamic applications  
Scales well, high throughput possible  
Many implementations, various qualities of service  
caveat emptor  
16  
Publish-Subscribe Messaging  
Extension of MOM to provide 1-to-N, N-to-1, and N-to-  
N communications  
Messages are „published‟ to logical subjects or topics  
Subscribers receive all messages from subjects they  
subscribe to  
Sub  
Create/  
Publish  
Register/  
Subscribe  
Pub  
Subject  
Sub  
Sub  
17  
Publish-Subscribe with Multicast  
S ubscriber  
S ubscriber  
rvrd  
rvd  
rvd  
Based on  
TIBCO  
Rendezvous  
Publisher  
rvd  
rvrd  
rvd  
S ubscriber  
S ubscriber  
S ubscriber  
18  
Performance  
M illise c o n d s  
7 0 0  
6 0 0  
5 0 0  
4 0 0  
3 0 0  
2 0 0  
1 0 0  
0
M C 1  
M C 2  
Q B  
1 0  
2 0  
rib e rs  
19  
Subject/Topic Naming  
Sydney  
DevGroup  
SupportGroup  
Information  
Information  
work  
gossip  
work  
gossip  
Sydney  
Sydney/DevGroup  
Sydney/*/Information  
Sydney/DevGroup/*/*  
Sydney/DevGroup/**  
Sydney/DevGroup/Information  
Sydney/DevGroup/Information/work  
Sydney/DevGroup/Informati
Sydney/SupportGroup  
Sydney/SupportGroup/Information  
Sydney/SupportGroup/Information/work  
Sydney/SupportGroup/Information/gossip  
20  
Tải về để xem bản đầy đủ
pdf 46 trang yennguyen 22640 Free
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Kiến trúc phần mềm - Chương: Mẫu thiết kế Middleware - Trần Minh Triết", để tải tài liệu gốc về máy hãy click vào nút Download ở trên

File đính kèm:

  • pdfbai_giang_kien_truc_phan_mem_chuong_mau_thiet_ke_middleware.pdf