5 Ways AI 2.0 Affects Architects: why GUI goes API

Applied AI got its second wind from big data, Internet of Things (IoT), and adaptive Content Delivery Networks (CDN). Ever since compilers moved from rocket science “AI” to everyday life, each AI wave heightens the crossbar of automation toward more complex tasks. AI in the 2010’s utilizes much more interaction of components and things (in IoT) than human-machine interaction (HMI), and has an impact on the entire architectural landscape, modeling, requirements, and more.


1. Cheaper big data
IoT enables millions of sensors from power plants, jet engines, cars, trains, medical electronics, athletes, endangered species, houses, surveillance, and more, to transfer large amounts of real-time data to big data stores. The decreasing cost of learning from big data boosts data driven AI. Among other things, the multitude of data makes welltried machine-learning technology deliver much smarter machines (Neural Networks, Evolutionary Algorithms, rule induction in general).

An increasing part of everyday life is in the virtual J hands of AI. The current crossbar lift offers high-skill, high-stake, high-responsibility decisions assisted, or sometimes even made, by AI. Last time I arrived to Swedish snow and winds, aboard a new 737, I was fascinated by the precise touchdown under harsh conditions. The captain told us that the crew’s task during landing was to “monitor that the systems worked”. I looked it up on the web, and found that Boeing and Airbus had several airliner types certified for autolanding already. Down to earth J indeed, compared to spacey cyber dreams of the past, or even to the tech side of dynamic analysis of a time series, or inferring if a set of patterns indicates an interesting situation or diagnosis, or adaptively learning from real-time data streams...

2. Less HMI
On one hand, improved HMI increased job satisfaction, and lessened both error rates and staff turnover. On the other hand, it diverted architectural focus away from the business-logic tier and from interactions that don’t involve humans. In other words, it improved the current state at the expense of this shift in most organizations. There are only tradeoffs in architecture, no free lunches...
Researchers gave us an advance notice 10+ years ago, when studies from Sweden indicated that business-IT users increasingly preferred “invisible” systems to flashy HMI and GUI.

3. Architecture

Few software architects were receptive to their message. Nevertheless, most advances in practice over the past decade are systems that either minimize or eliminate HMI: fly by wire, drones, train-control systems, driver assistants, driverless vehicles, etc.



I belong to the minority who claimed this shift would happen quickly, see also this Sequence Diagram contrasted to Use Cases in thisarticle (on SearchSoftwareQuality, 2007), but I admit I overrated the speed by years. As Dr. Oren Etzioni of the Allen Institute for AI put it in a recent interview: Never mistake a clear view for a short distance—it will take some time.

Likely, the transition from a CRUD-editor architecture to semantic operations in the business-logic tier will continue to smarter operations/services along the lines of “Vehicle stability system On/Off” (without additional HMI). Therefore, process owners and domain experts are ever-more important stakeholders, in application projects as well as in architecture.

With IoT in mind, the bridge-building between SW architects and product architects (HW, manufactured components, services, etc.) will continue to spill over, from automotive and manufacturing to other sectors. Product-package configuration often kick-starts such bridging, but implies architectural “design to configure” upfront.

4. Modeling
Tangible-product architects tend to emphasize static properties and form, whereas their colleagues in SW are leaning to dynamic, that is, behavior, functionality. The ability of many configurators to combine functional configuration (starting from a wish list of behavior and functions) with component configuration (starting from a wish list of components and parameter values) comes in useful in merging both traditions.

Another useful tool is the ability of standard modeling languages (UML SysML) to combine static and dynamic diagrams into a meaningful whole, without a split of focus and “too much to see”. Animation takes them a step further, and makes a useful visual explanation of an architecture to a large number of roles in a large organization; animations typically trigger comments that are very similar across industry sectors, from automotive electronics or telcos to energy or finance with intricate legacy: “I see at last why the whole thing works at all”, no matter hand-made logic or machine-made.
Rules, decision trees, or diagrams (UML, SysML) are both easy to animate and comprehensible to testers and other stakeholders. This can be contrasted to an underlying neural network where the corresponding logic is more “hard-wired” (likely, as weight values on synapses between artificial neurons).

5. Requirements and V&V
As complexity and business logic move into the system, from HMI and users’ Post-It notes, specifications of internal logic become more precise: Diagrams, rules, formulas, decision tables, etc. Security and safety become important early on, as well as tests in the business-logic tier.
An important complement to design-stage walkthroughs are virtual “tests” of a design, such as simulated wind-tunnel tests in a CAD-package or animations of both hand-made and machine-induced behavior in key scenarios (in a similar way as State diagram and Sequence diagram animations in UML/SysML tools).

Summing up
Architecture is not exempt from AI’s impact on high-skill professions. AI affects the complexity of systems we design, the architectural tradeoffs we make, the priorities among stakeholders and requirements, the architecture development process, the ways we model and explain architectures, and the ranking of quality attributes such as security, safety, or testability.
IoT and AI turn much of our attention to component interaction, business logic, and data; to cut a long story short, the “GUI” of the future is an API.




Trainer at Informator, senior modeling and architecture consultant at Kiseldalen.com,
main author : UML Extra Light (Cambridge University Press) and Growing Modular (Springer), Advanced UML2 Professional (OCUP cert level 3/3).

Milan and Informator collaborate since 1996 on architecture, modelling, UML, requirements, analysis and design. In the next couple of months, you can meet him at Architecture ( T1101 , T1430, in English or Swedish) or Modeling courses ( T2715, T2716 , in Swedish).

Java Date and Time API



I nästa version av Java, Java 8, kommer äntligen ett fullständigt bibliotek för hantering av datum och tid. Detta kommer att ersätta de befintliga klasserna som baseras på Date, respektive Calendar. Date är sedan länge deprecated men finns i många applikationer. Denna klass har en historia som baseras på den datastruktur som en gång fanns med i C från 1972. Den historiska ryggsäcken innehåller många märkligheter, såsom möjligheten att förändra ett datum, idag kan förvandlas till imorgon! Stöd för jämförelser mellan datum saknas, vilket krävs för sortering som ju är ett vanligt behov när man hanterar data innehållande någon form av datumstämpel. Det mest kuriösa inslaget i klassen Date är nog den konstruktor som tar tre parametrar, där man utgår från referensdatum där år sätts till 1900, månaderna börjar räknas från 0 och dag med värdet 1. I skrivande stund (2013-04-12) gäller således följande parameteruppsättning för att ange dagens datum Date(113, 3, 12
 
Javas nya Date and Time API kommer att placeras I en egen package-struktur med java.time som bas. Dokumentationen för de ingående klasser och interface antyder att API:et är mer svårbemästrat  än vad det verkligen är. Alla klasser är immutable, trådsäkra och baserade på den internationella standarden för kalendrar, ISO 8601. Även om huvudspåret följer den Gregorianska kalendern, så finns det stöd för många olika kalendrar såsom ThaiBuddhist respektive Japanese Imperial.  Månader som veckodagar hanteras nu med var sin Enum där konstanterna anges med engelska namn och har ett värdenummer som följer standard, vilket innebär att MONDAY räknas som dag 1 i veckan och DECEMBER har värdet 12. Det tog 18 år av Java-utveckling att komma hit…

De mest intressanta klasserna i API:et är följande:

LocalDate – Ett ”normalt” datum skrivet på formen YYYY-MM-DD enligt ISO-standarden och därmed kanske vi kan bli av med avarter som formaten mån/dag/år respektive dag/mån/år vilka kan ställa till stora problem där dag och månad lätt kan förväxlas. Bland en uppsjö av metoder kan nämnas ett flertal som tar fram ett nytt objekt baserat på stegning framåt eller bakåt utefter en datumlinje baserat på antal dagar, veckor, månader eller år.

LocalTime – En tidpunkt utan vare sig datum eller tidszon, med en upplösning på ner till nanosekund. Format enligt HH:MM:SS.xxxxxxxxx

LocalDateTime – En komplett tidsangivelse där såväl datum som tid på ett kombinerat format av de två beståndsdelarna med ett T som skiljetecken; YYYY-MM-DDTHH:MM:SS.xxx

Instant – En tidsstämpel som anges med nanosekunds precision. Detta är en klass som typiskt kommer att få stor användning vid loggning.

Clock – En abstrakt klass som kan användas för att ta fram aktuell tidpunkt, vilket även kommer att vara möjligt via metoden now() som finns i ett flertal klasser. Huvudsyftet med Clock är att stödja  plug-in av alternativa implementationer där exempelvis en offset kan anges. Clock kan typiskt förenkla tester med inbyggda tidsberoenden.

Duration – En klass som beräknar tid mellan två Instant objekt vilka anger tidpunkter utefter en tidslinje. Det är möjligt att beräkna negativ tid genom att ange inparametrar mot tidaxelns riktning.

ZoneId – En klass som modellerar tidszoner med ett id som är unikt inom systemet. Olika tidzoner kan anges med speciella prefix såsom 'UTC', 'GMT', 'UT' '+' eller '-', men kan också vara mera läsbara regionala id såsom Europe/Paris.

Slutligen ett citat från API dokumentationen som visar på att de nya klasserna och metoderna kan vara lätta att läsa och förstå även för en utomstående:
LocalDate customerBirthday = customer.loadBirthdayFromDatabase();
LocalDate today = LocalDate.now();
if (customerBirthday.equals(today)) {
 LocalDate specialOfferExpiryDate = today.plusWeeks(2).with(next(FRIDAY));
 customer.sendBirthdaySpecialOffer(specialOfferExpiryDate);
}

Kan det bli tydligare? Skynda att fynda!

/Kjell H Carlsson

Intresserad av att förkovra dig inom Java? Då ska du kika in på dessa länkar:

För dig som jobbar med API:er

Under våra community-day events har ett område framstått som mer och mer intressant och det är utveckling kring API:er i olika miljöer. Antingen du hanterar detta mer arkitekturbetonat eller är fullt upptagen av att koda så är det intressant för dig att veta att Informator har tagit fram ett fulltäckande kursutbud som hjälper dig bli mer effektiv i ditt arbete!

Nuförtiden kommer sajter/communities som tex. Facebook och Twitter att betyda allt mer för företag som vill finnas och kunna erbjuda lösningar på webben, vet man inte hur man bygger upp och kopplar infon till sajter som dessa så hamnar man oundvikligt efter.

Hela vårt kursutbud inom systemutveckling hittar du på vår samlingssida