Architectural Styles Team Team Team Team 1: 2: 3: 4: Interpreter; event driven Peer-to-peer; plug-in Service-oriented; publish-subscribe Rule-based; mobile code 1 Team Onesies: Jaime Pena, Carlos Montijo 2 ◦ What is it? ◦ What problem does it solve? ◦ How does it solve the problem? ◦ Who are the actors or main elements? ◦ How do they relate to each other? ◦ What are the strengths and drawbacks? ◦ Example applications? 3 Takes a program written in one language and interprets it to another language to execute a series of commands Also known as Virtual Machine Style 4 Facilitates coding in high level language, which can be interpreted into lower level language Interpreter can be used in different machines Suitable for applications in which most appropriate language or machine for executing solution is not directly available 5 Interpreter translates programming language for the user without requiring user to know the language Interpreter allows for portability Code interpreted in one machine will execute the same in another 6 Interpreter Engine ◦ receives input and generates output Interpreter State ◦ state of interpreter engine Program State Data Store Field ◦ progress of code interpreted ◦ source code 7 Input to the interpreted program component is sent to the program state, where it is read by the program running on the interpreter Program output is placed in the program state, where it can result in output from the interpreted program component's interface 8 9 Advantages Portability and flexibility of application or languages across various platforms Supports dynamic change “Sandbox” safety Disadvantages Slow Hard to design and test Cannot generate all possible programs to be executed 10 Java, Java Virtual Machine (JVM) Python-based applications Lisp Perl 11 Team Onesies: Alexandra Rebollosa, Achim Schweighofer, Heber Ramirez 12 A framework that orchestrates behavior around the production, detection and consumption of events as well as the responses they evoke Request/Response pattern Consists of “event creators” and “event consumers” Event: Any identifiable occurrence that has significance for system hardware/software Creator: Source of the event, only knows the event has occurred Consumer: Entity that needs to know the event has occurred, they might be involved in processing the event or they might simply be affected by the event 13 Real-time analysis of data and response of system Takes care of discrepancies in the system by following step-by-step rules ◦ E.g., when buying online using Amazon, a login is required in order to complete an order. If the customer is not a registered user, a new user must be created 14 It enables a large number of creators and consumers to exchange status and response information in near real-time. Most effective when existing business rules, triggers, and related stored procedures are surfaced and made available to the middleware’s event processor. In the short run, this means additional work for the database administrator.In the long run, it simplifies data management by making changes easier. 15 Event Generator ◦ Detects an event Event Channel ◦ Entry point to function, TCP/IP-Connection, File … Event Processing Engine Downstream Event-Driven Activity ◦ Selection of appropriate reaction ◦ Reaction to event 16 Event generator senses facts and converts the collected data into a standardized form The collected data is transferred over event channels to event engine (asynchronously) Event processing identifies the event, selects and executes the appropriate reaction Downstream event-driven activity 17 Advantages Strong support for reuse. Adding and replacing components with minimum effect on other components in the system. Disadvantages Loss of control, for example, in which order will components be evoked? Correctness hard to ensure since it depends on order of invocation. 18 Java Swing API JavaScript WinForms API 19 1. http://books.google.com/books?id=WHMksQOj6ScC&pg=PA76&lpg=PA76&dq=interpreter+ software+architecture&source=bl&ots=Wz3582xfgT&sig=E18v3bzd0LMGcKGHQynBW5Y5dh 0&hl=en&sa=X&ei=waMoT4CBCuiU2AWOy83iAg&ved=0CHcQ6AEwCA#v=onepage&q=interp reter%20software%20architecture&f=false 2. http://etd.lsu.edu/docs/available/etd-07082004-152330/unrestricted/Banerjee_thesis.pdf 3. http://www.thomasalspaugh.org/pub/fnd/architecture.html#Interpreter 4. 5. http://cs.queensu.ca/~ahmed/home/teaching/CISC322/F09/slides/CISC322_03_Architectur eStyles.pdf https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0CFUQFjAD& url=http%3A%2F%2Fwww.courses.utep.edu%2FPortals%2F870%2Ff11s12%2520handouts%2FSlides%2FL04b%2520More%2520Software%2520Architectures.pptx&ei=EEYuUqnhGaacygHwvoHwBQ&usg=A FQjCNGxOvLMOaUHiBd6duOo46mlx5BbBw&sig2=bnzA9WbAGiwme8hbIiGemA&bvm=bv.517 73540,d.aWc&cad=rja 6. http://se.inf.ethz.ch/courses/2011a_spring/soft_arch/lectures/14_softarch_styles.pdf 7. http://kristiannissen.wordpress.com/2009/10/15/javascript-event-driven-architecture/ 8. http://en.wikipedia.org/wiki/Event-driven_architecture 9. http://www.omg.org/soa/Uploaded%20Docs/EDA/bda2-2-06cc.pdf 10. http://searchsoa.techtarget.com/definition/event-driven-architecture 11. http://msdn.microsoft.com/en-us/architecture/aa699424.aspx 20 Team 2 Monica Galindo Andrea Dominguez Berenice Olivas Steven Werner Carlos Luevanos Daniel Guzman 21 Type of decentralized and distributed network architecture in which individual nodes in the network (called "peers") act as both suppliers and consumers of resources. (http://en.wikipedia.org/wiki/Peer-to-peer) The P2P style allows the client and server to swap their roles in order to distribute and synchronize files and information across multiple clients. It extends the client/server style through multiple responses to requests, shared data, resource discovery, and resilience to removal of peers. (http://msdn.microsoft.com/en-us/library/ee658117.aspx) 22 23 They solve the client-server problem where client nodes request access to resources provided by central servers. No need for centralized coordination from servers 24 By allowing peers to make their resources available to other network participants Resources such as processing power, disk storage or network bandwidth 25 Peers: independent components, having their own state and control thread. Connectors: Network protocols, often custom. Data Elements: Network messages Topology: Network (may have redundant connections between peers); can vary arbitrarily and dynamically Supports: decentralized computing with flow of control and resources distributed among peers. Highly robust in the face of failure of any given node. • Caution: Scalable in terms of access to resources and computing power. But caution on the protocol. (csse.usc.edu/classes/cs578_2013/Styles.ppt) 26 They relate to each other by sharing all their components i.e processors 27 It is easy to install and so is the configuration of computers on this network. All the resources and contents are shared by all the peers, unlike server-client architecture where server shares all the contents and resources. P2P is more reliable as central dependency is eliminated. Failure of one peer doesn’t affect the functioning of other peers. In case of Client –Server network, if server goes down whole network gets affected. There is no need for full-time System Administrator. Every user is the administrator of his machine. User can control their shared resources. The over-all cost of building and maintaining this type of network is comparatively very less. http://www.ianswer4u.com/2011/05/peer-to-peer-networkp2p-advantages-and.html#axzz2ePzeqMIW 28 In this network, the whole system is decentralized thus it is difficult to administer. That is one person cannot determine the whole accessibility setting of whole network. Security in this system is very less. Viruses, spywares, trojans, and malwares can easily be transmitted over this P2P architecture. Data recovery or backup is very difficult. Each computer should have its own back-up system. Lot of movies, music and other copyrighted files are transferred using this type of file transfer. P2P is the technology used in torrents. http://www.ianswer4u.com/2011/05/peer-to-peer-network-p2p-advantagesand.html#axzz2ePzeqMIW 29 Distribution of copyrighted files. Security issues. Bandwidth consumption. http://www.slideshare.net/srijish/p2p-principle-architecture-and-challenges-presentation 30 Fault Tolerance: Decentralized logical networks which could support any type of data. BitTorrent: P2P file sharing protocols. It accounts for a significant amount of traffic on the Internet. Peercasting: Like broadcasting. Method of streaming content to consumers. http://p2peducation.pbworks.com/w/page/8897427/FrontPage 31 Structural version: Futuristic Vertical City Holds Plug-In Hexagonal Housing Units Software version: We currently use all the time… [1] 32 A plug in is a software component that adds a specific feature to an existing software application Works as a puzzle piece, adding to the big picture, not changing it [2] 33 to enable third-party developers to create abilities which extend an application to support easily adding new features to reduce the size of an application to separate source code from an application because of incompatible software licenses. 34 Many, even unknown ones… ◦ Adding functionality for specific purpose Examples: OneTab for Chrome Browser 35 Firefox [3] 36 Word [4] 37 Provides framework for developers to add features Does not require source code to do it 38 39 Separate valid plug-in modules ◦ Implemented independently ◦ Usually one function/focus ◦ Contribute functionality to many applications that fit the architecture Host Application 40 Each plug-in has a well defined interface Host application must define a plug-in architecture Plug-in fits like a piece to a puzzle (application) Abstract base class (principle class) included as part of plug-in bundle ◦ Support code and resources Host application checks if it conforms to requirements ◦ If yes, then an instance is generated 41 Expandability ◦ Poor interface design restricting extension ◦ Include new features Parallel Development ◦ Multiple features can be developed simultaneously Clear Development Simplicity ◦ Plugin typically only does one thing Strengths Maintainability ◦ Managing backward compatibility Complexity ◦ Plugin interactions cause bugs ◦ Well defined interface Extensibility Testing ◦ Cumbersome without mock plugin runner Weaknesses 42 http://www.slideshare.net/srijish/p2p-principlearchitecture-and-challenges-presentation http://www.ianswer4u.com/2011/05/peer-topeer-network-p2p-advantagesand.html#axzz2ePzeqMIW http://msdn.microsoft.com/enus/library/ee658117.aspx csse.usc.edu/classes/cs578_2013/Styles.ppt http://www.dmst.aueb.gr/dds/pubs/jrnl/2004ACMCS-p2p/html/AS04.html http://p2peducation.pbworks.com/w/page/8897 427/FrontPage (http://en.wikipedia.org/wiki/Peer-to-peer) 43 Images: ◦ [1] http://inhabitat.com/plug-your-hexagonal-house-into-thisvertical-city/ ◦ [2] https://developer.apple.com/library/mac/documentation /Cocoa/Conceptual/LoadingCode/Concepts/Plugins.html ◦ [3] https://addons.mozilla.org/en-US/firefox/ ◦ [4] http://msdn.microsoft.com/en-us/library/office/ ◦ aa189710(v=office.10).aspx References ◦ http://stackoverflow.com/questions/2818415/what-are-the-advantages-anddisadvantages-of-plug-in-based-architecture ◦ https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Loadin gCode/Concepts/Plugins.html 44 Publish-Subscriber Style Service-Oriented Style 45 Message pattern where senders of the messages (publishers) do not program the messages to be sent directly to a specific receiver (subscribers). the message will be seen by a subscriber once they have subscribed to the publisher What? publishers don’t have to know who the subscribers are subscribers will only have information of subscribers that they are interested with Why? 46 How: This architecture uses filtering in order to ensure that only certain information is delivered to specific users Actors: Actor Relations: ◦ Publisher ◦ Event Channel ◦ Subscriber ◦ Subscribers choose which publisher they wish to receive information for ◦ Publishers publish an even to a “channel” ◦ The channel receives information of subscribers as well as publishers allowing the subscriber to receive pertinent information from the chosen publisher 47 scalability, through clever protocols the publisher/subscriber pattern allows for higher message loads from a small number of data center This favors scalability through parallel operations, and tree or network based routing by not being dependent on each other they can work independently despite the state of the others. Strength The pattern must be carefully coded to allow certain features like guaranteed delivery of messages There may be an assumption of an audience when one may not be present Loose Coupling is also a disadvantage because it is hard to guarantee outcomes since the publisher has little information from subscribers Drawbacks Examples: RSS Feeds, YouTube 48 Computing based on request and reply. Provides application functionality as service. Allow easy cooperation of a large number of computers that are connected over a network. Modules driven implementation. It gives the ability to develop What? new functions rapidly. Improved information flow. Organizational flexibility. Lower software development and management costs. (reuse). Security attacks. Data confidentiality and integrity. Maintenance and upgrade. Reliability. Why? 49 How: Actors: This architecture takes advantage of previously defined services in order to promote re-usability as well as quick delivery of services ◦ Service provider, ◦ Service directory (registry), ◦ Service consumer Actor Relations: ◦ The service provider publishes and secures the service in a service directory. ◦ The service consumer locates and accesses the service in the service directory. ◦ The service consumer manages the service provided by the service provider. 50 ◦ Service can be re-used. ◦ Messaging: control, monitoring, transformation, security. ◦ Complex event processing (ability to adapt) ◦ service discovery ◦ Virtualization (improved reliability) ◦ Model-driven implementation. ◦ Easy maintenance. ◦ Loose Coupling ◦ Overhead ◦ Complexity ◦ Configuration management ◦ Governance ◦ Hard to implement when starts at zero. Examples: TurboTax, Wells Fargo, Cricket wireless, Strengths Drawbacks Facebook, Dropbox 51 Birman, K. and Joseph, T. "Exploiting virtual synchrony in distributed systems" in Proceedings of the eleventh ACM Symposium on Operating systems principles (SOSP '87), 1987 Hasan, Souleiman, Sean O'Riain, and Edward Curry. 2012. "Approximate Semantic Matching of Heterogeneous Events.“ http://msdn.microsoft.com/enus/magazine/hh201955.aspx http://en.wikipedia.org/wiki/Publish%E2%80%93s ubscribe_pattern 52 http://searchsoa.techtarget.com/definition/s ervice-oriented-architecture http://www.javaworld.com/javaworld/jw-062005/jw-0613-soa.html http://www.opengroup.org/soa/sourcebook/soa/soa_features.html www.exforsys.com 53 54 Software that can duplicate human knowledge and reason from it. A collection of knowledge, which can be a set of rules. Database of facts Based on Condition-Action Rules 55 Shortage of experts. ◦ Duplicating expert reasoning quickly. 56 User Interface Rule Engine Inference Engine Process Working Memory Temporary Data Rule Base Permanent Data 57 Strengths ◦ Knowledge of experts can be duplicated. ◦ Can be adapted to many different fields. ◦ Easy for humans to understand Drawbacks ◦ Can only be used were knowledge can be describe as an If-Then statement. ◦ The larger the number of statements the slower the system will perform. ◦ Is it possible to capture all knowledge? 58 AI Voice Server Health Care Financial Service. 59 60 Code is portable since it can run anywhere No installation load on server is reduced, since the code is run on client machine interoperability user unaware that mobile code is executing on their machine 61 java applets activeX controls macros in MS office scripts 62 "Mobile Code." Mobile Code. 11 Sept. 2013 <http://courses.ischool.berkeley.edu/i206/f97/ GroupC/sld003.htm>. "Mobile Code Security." Mobile Code Security. 11 Sept. 2013 <http://seit.unsw.adfa.edu.au/staff/sites/lpb/pa pers/mcode96.html>. Ireson-Paine, Jocelyn. "What is a rule-based system?" What is a rule-based system? 14 Feb. 1996. 11 Sept. 2013 <http://www.jpaine.org/students/lectures/lect3/node5.html>. 63