Software Engineering and Architecture

Slides:



Advertisements
Similar presentations
Executional Architecture
Advertisements

DAIMIHenrik Bærbak Christensen1 Mandatory Project Part II Software Reliability and Testing.
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Windows Azure Team 9 Ben Holland Bao Nguyen Eric Petrowiak Barret Schloerke.
SOFTWARE ENGINEERING MCS-2 LECTURE # 4. PROTOTYPING PROCESS MODEL  A prototype is an early sample, model or release of a product built to test a concept.
Chapter 9 Putting together a complete system. This chapter discusses n Designing a complete system. n Overview of the design and implementation process.
CS 151: Object-Oriented Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
The HotCiv GUI Instantiating the MiniDraw Framework.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Test Stubs... getting the world under control. TDD of State Pattern To implement GammaTown requirements I CS, AUHenrik Bærbak Christensen2.
Henrik Bærbak Christensen1 Test Driven Development “TDD” Summary.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Mandatory 1 / AlphaCiv … Traps to be aware of …. Warn or not? I once asked Kent Beck the following –I have a lot of students in a course in design patterns.
Applying the Principles Two Examples. Example 1 New Requirement It would be nice with a simple GUI “to see something” instead of just xUnit tests...
Refactoring and Integration Testing or Strategy, introduced reliably by TDD The power of automated tests.
MiniDraw Introducing a Framework... and a few patterns.
Mandatory 1 / AlphaCiv … a few comments…. Overall: Generally – good work – good effort Seems you are generally doing TDD Minor hick-ups –”My own way is.
Software Architecture Quality Attributes. Good or Bad? Measurable criterions required...
Event Sources and Realtime Actions
Instantiating the MiniDraw Framework
Introducing a Framework ... and a few patterns
Business System Development
Software Architecture in Practice
Software Architecture in Practice
Scalability: Load Balancing
Applying the Principles
HotCiv Project Starting up!.
MVC and other n-tier Architectures
Mandatory 1 / AlphaCiv … Traps to be aware of ….
Web Software Model CS 4640 Programming Languages for Web Applications
Singleton Pattern Command Pattern
Software Architecture Quality Attributes
LCGAA nightlies infrastructure
Software Architecture in Practice
Ch > 28.4.
Ch 15 –part 3 -design evaluation
Model-View-Controller Patterns and Frameworks
Model-View-Controller (MVC) Pattern
Week 7, Class 1: The Command Pattern (cont.)
Software testing.
CS323 Android Topics Network Basics for an Android App
Outline Announcements Lab2 Distributed File Systems 1/17/2019 COP5611.
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Chapter 15: File System Internals
Outline Review of Quiz #1 Distributed File Systems 4/20/2019 COP5611.
Model, View, Controller design pattern
11. MVC SE2811 Software Component Design
11. MVC SE2811 Software Component Design
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Container technology, Microservices, and DevOps
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Presentation transcript:

Software Engineering and Architecture Hints on Broker II Mandatory

Henrik Bærbak Christensen Broker II Learning Goal Get the return object reference methods implemented getUnitAt(p), and cousins... Get the Invoker code integrated Get the MiniDraw GUI integrated in a full client Product Goal JUnit test suite that cover all broker related code System testing of a full HotCiv GUI based product! Wow!  CS@AU Henrik Bærbak Christensen

Henrik Bærbak Christensen Broker 2.1 TDD the Game methods that return object references. That is, write JUnit tests that implement the FRDS process AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen Broker 2.1 What about Tile? AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen Broker 2.2 Integrate the Invokers from last exercise, ensure that they are split into sub invokers. That is, remove the fakeit objectId code parts from last exercise, and refactor to use multi type dispatch. AU CS Henrik Bærbak Christensen

2.3 System Testing Gui, Client, Observer???

The Grand Finale System Testing. Story: Pedersen and Findus play a game of HotCiv Disclaimer: Screenshot is a Unit Test  AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen Observer so far There are two observers Both Servant and ClientProxy have one Last Iteration Make them shut up… It works well because What is the role of the Observer? To inform the GUI about state changes in the Game domain And – we had no GUI  AU CS Henrik Bærbak Christensen

But CivDrawing Observes Game From the Iteration 8 exercise, the Minidraw Drawing role have to observe on Subject Game Now, CivDrawing will be notified about events in the Game, like worldChangedAt(p) AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen But... So – requirements collide here  GUI can only update based on Observer events from Game FRDS.Broker insists on not making a remote observer possible because It would require a mirrored Broker Server would have to call ClientProxies of objects on the client side, which require a Requestor and ClientRequestHandler Clients would have to accept incoming method calls, that is implement Servant, Invoker, ServerRequestHandler Architecturally, scaling is difficult Server would accept 1.000.000 clients, will never perform... AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen So What? Early web server systems had the same issues and invented some ways to circumvent it Polling. Client periodically invokes server to get any state changes since last poll. Requires a separate thread with a timer; require sequence numbers on all state events... Long polling. Client invokes a method with a very long time out, which only returns once there has been a change on the server. And then makes a new long polling call indefintely. Also requires a separate thread for handling this long poll. I suggest to take a crude and implementation-wise cheap route instead... AU CS Henrik Bærbak Christensen

Observer on the ClientProxy We simply implement the Subject behaviour in the GameClientProxy as usual, ala Exercise: What do we achieve by that? What do we NOT achieve? That the GUI for user A actually reflect user A’s unit movement correctly. BUT NOT THAT OF B. AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen Client Manual Refresh Introducing the (ugly) refresh button In GfxConstants Update your CompositionTool so mouseUp() events on button call the Drawing role’s requestUpdate() editor.drawing().requestUpdate() AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen Discussion Does this have a flavour of being tacked on? Yep! But still ‘refresh’ is quite common : Alternative: Optional Exploration Exercise Make server side observer that keeps log of state events with a incrementing sequence number (index in array may suffice) Make a client side observer that periodically poll the server to fetch a list of all stateevents since the last fetched event getEventsSinceEventWithID(47) or something like that... AU CS Henrik Bærbak Christensen

Chatty Interface

Henrik Bærbak Christensen We pay a penalty... In the MiniDraw exercise, I advocated a crude update policy Will rebuild by query all positions for the units on them. This is 256 remote calls! AU CS Henrik Bærbak Christensen

Henrik Bærbak Christensen Chatty Interface That is, the client is chatty. Networks are slow so it takes awfully long time to complete... Build Chunky Interfaces for remote calls Implement client side caching in getUnitAt(p) First call: bulk transfer all unit information, store in internal data structure (the cache), and make a timestamp Next calls: if less than N seconds since cache was populated, just return cache contents. If more than N seconds then reload from the server again. AU CS Henrik Bærbak Christensen

Happy Coding... Post/Mail in case if unforseen problems!!! Conclusions Happy Coding... Post/Mail in case if unforseen problems!!!