Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Architectural Models. Keywords Middleware Interface vs. implementation Client-server models OOP.

Similar presentations


Presentation on theme: "Chapter 2 Architectural Models. Keywords Middleware Interface vs. implementation Client-server models OOP."— Presentation transcript:

1 Chapter 2 Architectural Models

2 Keywords Middleware Interface vs. implementation Client-server models OOP

3 Process Classification in DS Classified by responsibilities Server processes E.g. SQL server, Web server Client processes Web browser, SQL query analyzer Peer processes chat

4 Software layers

5 Platform Lowest-level hardware and software E.g. Intel X86, Sun SPARC E.g. Windows, SunOS Q: which one is better: multiple standards or single standard?

6 Middleware Mask heterogeneity/implementation Transparency Provide convenient programming model Commonly implemented over internet protocols TCP/IP Examples: JVM, CORBA, DCOM, RMI

7 Middleware Services Communication facilities Naming Distributed transactions Persistent storage Stores persistent objects (in marshaled form), which live between activations by servers Persistent Java, CORBA persistent object service. Security

8 Middleware And Openness Protocols used by each middleware layer should be same; Similarly for interfaces they offer to applications.

9 Middleware Limitations Platform independence  Middleware dependence “Some communication-related functions can be completely and reliably implemented only with the knowledge and help of the application standing at the end points of the communication system” [Saltzer, Reed and Clarke, 1984]

10 Examples Transferring large files TCP not enough Irrigating farm-land Rule: requiring help from higher-level Q: Can mankind comprehend itself?

11 Client-Server Model

12 Relationship Client/server is a process. M-to-M Servers may in turn be clients of other servers. E.g. web server, search engines

13 Improvements/Variations Multiple servers Partition jobs Maintain replicated copies Caches Peer processes Reduce the delay of access Eliminate the bottleneck Group communication Mobile code, like web applets

14 Multiple-threads Server Warm-up: threads vs. processes Usually a server (which is a process) has multiple threads for concurrency reason. E.g. web server Same principle applies to client. E.g. web browser

15 OO Implementation Object-oriented programming class and instance encapsulation (information hiding ), inheritance (with overriding) and polymorphism OO approach Everything is an object Not true in C++ Modular Interaction by messages

16 OO benefits Encapsulation Protection by controlled access (values and synchronization) Information hiding (internal operations can be modified as long as interface is kept same) Inheritance Overriding (can also add new methods and variables) Efficient software development Polymorphism

17 Method-overloading Different methods in the same class can have same name, provided number and/or types of arguments are different for each method. Why do we need it? class Example { public static int doubleIt (int x) {return 2*x;} public static String doubleIt (String x) { return x + x;} }

18 Polymorphism Same method name means different things, depending on object’s position in hierarchy. In Java, objects implementing same interface or extending same superclass can override method to do different things. Separation of interface and implementation

19 Example: Device Driver Define interface with generic methods, e.g., read and write. Individual device drivers override those abstract methods. Same message sent to variety of objects would then take on different forms.

20 OO benefits --- Really? Difficult to achieve all the goals Careful design, future prediction, code reuse Design patterns, refactoring techniques Managers tend to overlook them. Does it improve coding efficiency? Said by a survey: not much compared to memory-management-hiding techniques

21 Fundamental Models of DS Interaction model Failure model Security model

22 Interaction Model Multiple processes Rate and timing of message passing cannot in general be predicted. Two significant factors Communication channel Latency, bandwidth, jitter Computer clocks and timing events Clock drift

23 Two Variants Synchronous: There is upper-bound T (sec) on time from sending request till receiving reply On timeout one can conclude there is failure. Asynchronous: No finite upper-bound, but guaranteed to be finite under no failure (e.g., Internet) cannot tell if network is being slow or has failed. Comparisons.

24 Event Ordering User X sends a message with the subject Meeting Users Y and Z reply with the subject Re: Meeting ItemFromSubject 23ZRe: Meeting 24XMeeting 25YRe: Meeting Seen by user A

25 Failure Model Omission failures Fail to perform actions Arbitrary failures Timing failures How to mask failures? Re-transmit message Checksum: Hamming code

26 Security Model Protect objects Access rights Protect processes and their interactions Threats to servers, clients Communication channel Copy of m Process p q m The enemy m’

27 Defeating Threats Cryptograph and shared secrets Using large numbers as secret keys Authentication User names passwords Secure channels


Download ppt "Chapter 2 Architectural Models. Keywords Middleware Interface vs. implementation Client-server models OOP."

Similar presentations


Ads by Google