Download presentation
Presentation is loading. Please wait.
1
Software Architecture in Practice
Exercise H1 Architectural Description TM16
2
Provided: TM16 report template TM16 source code LaTeX Java
Ant build mgt. system Ivy dep. mgt. system Review the README Try it out – ’ant help’ Inspect source code H B Christensen
3
Case - Challenges (Our research: www.net4care.org)
Demographic challenges 2009: 70% of public health expenditure goes to chronic diseases 2040: 100% more elderly Geographical challenges Larger, fewer hospitals Fewer general practitioners Leads to a need for telemedical solutions ICT-supported healthcare services where some of the people participating in service delivery are not co-located with the receiver of the service (Our research: H B Christensen
4
Vision Vision Motivation
Replace out-patient visits by measurements made by patients in their home Move data from home to regional/national storage so all health care personal can view them... Motivation Reduce out-patient visits Better quality of life Cost savings Better traceability and visibility H B Christensen
5
Use case 1 2) BP measurement stored as HL7 document
1) Inger measures her BP using her TM16 terminal H B Christensen
6
Use case 2 2) Query for all BP documents associated with Inger
1) GP queries last month’s BP measurements for Inger using web browser H B Christensen
7
(What is XDS) Cross-Enterprise Document Sharing Think
One Registry + Multiple Repositories Repository: Stores clinical documents (id,document) pairs Registry: Stores metadata with document id Metadata (cpr, timeinterval, physician, measurement type,...) Id of associate document and its repository Think Registry = Google (index but no data) Repository = Webserver (data but no index) H B Christensen
8
(What is HL7) HL7 is a standard (complex!) for clinical information storage and exchange. Version 3 loves XML! Our version: Real version: H B Christensen
9
Demo Start a server Send an obs. GP review in browser ant server
ant home GP review in browser Use case 1 Use case 2
10
Henrik Bærbak Christensen
Demo 2 ifconfig eth0 Can talk remotely Fire up a new machine, note its IP ant home –Dhost= Henrik Bærbak Christensen
11
Skeletal system TM16.zip Tool chain - choose:
Download and unzip Now you can read Get tool chain Now you can execute Tool chain - choose: VM path: Get the fully working virtual machine Manual path: Install all tools on your local machine Ensure they are correctly installed View the Tools web page... H B Christensen
12
Henrik Bærbak Christensen
Getting Started I actually recommend using the VM In particular if you are not core Java developer Docker is bit tricky on Mac and Win machines Getting TM16 up and running Review the screencasts, links on weekplan! Henrik Bærbak Christensen
13
Henrik Bærbak Christensen
Tool chain Java programming language Lots of tutorials on the web, use them Ant build management Probably you do not need to change it ‘ant server’, ‘ant home’, … Ivy dependency management Automatically download all dependencies Review the screencasts on the weekplan Henrik Bærbak Christensen
14
Henrik Bærbak Christensen
IDE I stick to Eclipse even though many say IntelliJ is better Review screencasts on weekplan Importing TM16 + Updating once dependencies are changed Please, adhere to this rule Source files encoded in UTF-8 (not default on Windows!) Indent using spaces! Preferences -> java -> code style -> formatter Create new profile Pane ‘indentation’ Henrik Bærbak Christensen
15
Henrik Bærbak Christensen
Code structure Baerbak projects src = Production code test = Junit test code Run tests Right click ‘test’ package Run As -> JUnit Test Screencast ‘import into eclipse’ Henrik Bærbak Christensen
16
Henrik Bærbak Christensen
Dependency Injection I have written a book on Flexibility Program to interface Role is expressed by interface Favour Object Composition Small services collaborate to form whole Dependency injection The services you collaborate with are provided to you (injected) Henrik Bærbak Christensen
17
Henrik Bærbak Christensen
Example TeleMed : Role of a tele medicine system/server XDSBackend: Role of an XDS database system Xds is injected into the telemed I can configure any suitable variant of the system by selecting the right implementations of roles to inject! Henrik Bærbak Christensen
18
Henrik Bærbak Christensen
Test Doubles I have written a book on Reliability Test Doubles Replacements for real ‘depended-on units’ that are under test control Test cases in JUnit Inject test doubles instead of ‘real’ units to ease and control testing Henrik Bærbak Christensen
19
Henrik Bærbak Christensen
Example XDSBackend: Role of an XDS database system FakeObjectXDSDatabase: A fake test double No persistence, all in-memory! I can test TeleMed code without starting a real XDS database server; it is much faster and initial state is well-defined = empty database Henrik Bærbak Christensen
20
TM16 served another purpose
Broker TM16 served another purpose
21
Distributed Computing
I am writing the 2nd edition of my book on Distributed Computing Broker pattern ? Henrik Bærbak Christensen
22
Henrik Bærbak Christensen
FRS 2nd Edition Broker Henrik Bærbak Christensen
23
Henrik Bærbak Christensen
Broker Example TeleMed implementation is on machine ‘server’ On client we want to call teleMed.processAndStore( myBloodPressure ); But networks only have send(address, byte[]); Byte[] receive(); Henrik Bærbak Christensen
24
Henrik Bærbak Christensen
Client Side Broker Broker dynamics on Client side ClientProxy: Implements TeleMed interface Convert every call into requests to the Requestor Requestor: Does marshaling = convert data to byte array format Typically JSON or XML ClientRequestHandler Binds to the OS and particular network protocol Sockets, HTTP, Messaging Does the ‘send(payload) and blocks until answer returned Henrik Bærbak Christensen
25
Henrik Bærbak Christensen
Server Side Broker Broker dynamics on Server side ServerRequestHandler: Binds to the OS and network protocol Receives payload from ClientRequestHandler Invoker: Demarshals byte[] into parameters Dispatches to proper method and proper servant object Servant: Implements TeleMed interface The real implementation! Henrik Bærbak Christensen
26
Henrik Bærbak Christensen
Why all the trouble? Now we can configure our own Broker system A HTTP based client And HTTP webserver based server See the TM16 code for a socket based variant Henrik Bærbak Christensen
27
Unit Testing Distribution!
Why code the broker myself? One big advantage: Test doubles Now single VM system! Henrik Bærbak Christensen
28
Henrik Bærbak Christensen
Remember: Roles They are all roles One object may play several In REST and HTTP you often merge e.g. ServerRequestHandler and Invoker Because typically you use HTTP verbs, GET, POST, PUT, = operation names Routes /bp/pid01 = object identifiers Thus embody responsibilities from both roles… Henrik Bærbak Christensen
29
Henrik Bærbak Christensen
In TM16 In the documentation exercise next (H1) do not spend an awful lot of energy on the Broker part Early release of my book chapters are on the course web page Henrik Bærbak Christensen
30
Henrik Bærbak Christensen
Exercise H1 Henrik Bærbak Christensen
31
Exercise H1 Document the Module viewpoint C&C viewpoint
Rather mechanically Find packages and classes But what to abstract and what not? Hint: Broker is detailed elsewhere C&C viewpoint What does it do? Deployment viewpoint The ’real’ production deployment The +1 Architectural significant scenarios H B Christensen
32
Digging in... Where to start? Learning tests! Manual tests!
Lots of code, many variants Learning tests! TestScenario.java Manual tests! Review build.xml H B Christensen
33
Important TM16 is somewhat large ! Beware: Discuss, ask questions
Much code is not really architectural! Do not dispair but keep me informed!!! Use the web forum Discuss, ask questions H B Christensen
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.