Ngon ngu UML - BAI8

Chia sẻ: Son Cung | Ngày: | Loại File: PDF | Số trang:68

0
191
lượt xem
113
download

Ngon ngu UML - BAI8

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Tham khảo tài liệu 'ngon ngu uml - bai8', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả

Chủ đề:
Lưu

Nội dung Text: Ngon ngu UML - BAI8

  1. Phaân tích vaø Thieát keá Höôùng ñoái töôïng duøng UML Module 8: Thieát keá kieán truùc PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 1
  2. Muïc tieâu: w Tìm hieåu muïc ñích cuûa coâng ñoaïn Thieát keá kieán truùc vaø thôøi ñieåm thöïc hieän coâng ñoaïn naøy w Dieãn giaûi veà caùc cô cheá thieát keá vaø caøi ñaët vaø caùch gaùn chuùng töø caùc cô cheá phaân tích w Tìm hieåu veà subsystems aaø interfaces vaø vai troø cuûa chuùng trong kieán truùc heä thoáng w Moâ taû quy trình xaùc ñònh caùc interfaces vaø subsystems w Tìm hieåu caùc lyù leõ vaø caùc côû sôû hoã trôï cho caùc quyeát ñònh veà kieán truùc PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 2
  3. Vò trí cuûa Phaân tích kieán truùc Architectural Analysis Architectural Describe Review the Architecture Describe Architecture Reviewer Architect Design Concurrency Distribution Subsystem Design Use-Case Analysis Review the Use-Case Design Design Designer Design Reviewer Class Design PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 3
  4. Toång quan veà phaân tích kieán truùc Glossary Software Architecture Design Document Design Supplementary Guidelines Guidelines Specifications Architectural Analysis Classes Design Design Model Design Model PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 4
  5. Architectural Design Topics w Caùc khaùi nieäm then choát w Caùc cô cheá thieát keá vaø caøi ñaët w Caùc Design Class vaø Subsystem w Caùc khaû naêng taùi söû duïng w Toå chöùc moâ hình thieát keá w Checkpoints PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 5
  6. Architectural Design Topics w Caùc khaùi nieäm then choát w Caùc cô cheá thieát keá vaø caøi ñaët w Caùc Design Class vaø Subsystem w Caùc khaû naêng taùi söû duïng w Toå chöùc moâ hình thieát keá w Checkpoints PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 6
  7. Moâ hình kieán truùc “4+1 View” Logical View Implementation View End-user Analysts/Designers Programmers Functionality Structure Software management Use-Case View Process View Deployment View System integrators System engineering Performance System topology Scalability Delivery, installation Throughput communication Logical View laø phaàn coù yù nghóa veà maët kieán truùc cuûa Design Model PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 7
  8. Nhaéc laïi: Class vaø Package w Theá naøo laø class? § Laø moâ taû cuûa moät taäp caùc ñoái töôïng cuøng chia xeû caùc traùch nhieäm, moái quan heä, caùc taùc vuï, thuoäc tính, vaø ngöõ nghóa. Class Name w Theá naøo laø package? § Laø moät cô cheá duøng chung ñeå nhoùm caùc phaàn töû thaønh caùc nhoùm § Laø moät phaàn töû cuûa moâhình coù theå chöùa beân trong caùc phaàn töû khaùc Package Name PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 8
  9. Caùc Global Package w Toaøn boä package ñöôïc söû duïng bôûi taát caû caùc package khaùc w Nhöõng package naøy ñöôïc ñaùnh daáu laø global Foundation Classes global PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 9
  10. Architectural Design Topics w Caùc khaùi nieäm then choát w Caùc cô cheá thieát keá vaø caøi ñaët w Caùc Design Class vaø Subsystem w Caùc khaû naêng taùi söû duïng w Toå chöùc moâ hình thieát keá w Checkpoints PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 10
  11. Caùc cô cheá thieát keá vaø caøi ñaët Analysis Design Implementation Mechanism Mechanism Mechanism (Conceptual) (Concrete) (Actual) Legacy Data Persistency RDBMS JDBC New Data Persistency OODBMS ObjectStore Distribution Remote Method Java 1.2 from Sun Invocation (RMI) Analysis Design Implementation PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 11
  12. Documenting Architectural Mechanisms w Caùc cô cheá kieán truùc coù theå xem nhö caùc khuoân maãu (pattern) Template Parameters Pattern Name Structural Aspect Behavioral Aspect Ñöôïc ghi nhaän trong Design Guidelines PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 12
  13. Ví duï: Persistency: RDBMS: JDBC PersistencyClient Roles seõ ñöôïc ñieàn bôûi designer (from SamplePersistency Client) aùp duïng cô cheá PersistentClassList (from SamplePersistentClass) new() add(c: PersistentClass) DBClass 1 0..* create() : PersistentClass read(searchCriteria : string) : PersistentClassList PersistentClass update(c : PersistentClass) (from SamplePersistentClass) delete(c : PersistentClass) 1 getData() setData() command() new() DriverManager (from java.sql) 1 getConnection(url, user, pass) : Connection Statement ResultSet (from java.sql) Connection (from java.sql) (from java.sql) executeQuery(sql : String) : ResultSet createStatement() : Statement getString() : string executeUpdate(sql : String) : int PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 13
  14. Ví duï: Persistency: RDBMS: JDBC: Khôûi taïo : DBClass : DriverManager 1. getConnection(url, user, pass) PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 14
  15. Ví duï: Persistency: RDBMS: JDBC: Create : : DBClass : : Connection : Statement PersistencyClient PersistentClass 1. create( ) 1.1. New() 1.2. getData( ) 1.3. createStatement( ) 1.4. executeUpdate(String) PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 15
  16. Ví duï: Persistency: RDBMS: JDBC: Read : : DBClass : Connection : Statement : ResultSet : : PersistencyClient PersistentClassList PersistentClass 1. read(string) returns a The SQL statement Statement built by the DBClass 1.1. createStatement( ) using the given criteria is passed to The criteria used to executeQuery() access data for the 1.2. executeQuery(string) persistent class Create a list to hold all 1.3. new( ) retrieved data 1.4. new() Repeat these operations for each element returned from 1.5. getString( ) the executeQuery() called for each command. attribute in the 1.6. setData( ) class The PersistentClassList is loaded with the data retrieved from the database. 1.7. add(PersistentClass) Add the retrieved course offering to the list to be returned PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 16
  17. Ví duï: Persistency: RDBMS: JDBC: Update : : DBClass : : Connection : Statement PersistencyClient PersistentClass 1. update(PersistentClass) 1.1. getData( ) 1.2. createStatement( ) execute SQL statement 1.3. executeUpdate(string) PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 17
  18. Ví duï: Persistency: RDBMS: JDBC: Delete : : DBClass : Connection : Statement PersistencyClient 1. delete(PersistentClass) 1.1. createStatement( ) execute SQL statement 1.2. executeUpdate(string) PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 18
  19. Toång hôïp JDBC: Caùc böôùc w Cung caáp khaû naêng truy caäp ñeán class libraries caàn thieát ñeå caøi ñaët JDBC § Cung caáp java.sql package w Taïo caùc DBClass caàn thieát § Moät DBClass / persistent class w Tích hôïp caùc DBClass vaøo thieát keá § Xeáp ñaët vaøo package/layer Deferred § Theâm caùc moái quan heä töø caùc persistency client w Taïo/caäp nhaät interaction diagram ñeå dieãn taû: § Database initialization § Persistent class access: Create, Read, Update, Delete PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 19
  20. Ví duï: Toång hôïp JDBC Sample Persistency Client Package java.sql DriverManager Connection (from java.sql) (from java.sql) Statement ResultSet (from java.sql) (from java.sql) PT & TK Höôùng ñoái töôïng – Thieát keá kieán truùc Döông Anh Ñöùc 20
Đồng bộ tài khoản