Kleine Einführung in die Entwicklung von RESTful APIs mit Dart. Auskopplung eines Foliensatzes aus der Lehrveranstaltung Webtechnologien des Studiengangs Informatik/Softwaretechnik der Fachhochschule Lübeck.
Diese Präsentation gibt einen umfassenden Überblick über die Programmiersprache Dart und ihre Konzepte. Um diesen Überblick schnell erfassen zu können, ist es hilfreich eine Programmiersprache wie bspw. Java zu beherrschen sowie die Konzepte der Objektorientierung zu kennen.
Im Teil I wird die Sprache Dart an sich dargestellt. Es wird ein Überblick über die optionale Typisierung, Datentypen, Funktionen, Operatoren, OO-Möglichkeiten sowie Generics in Dart gegeben.
Teil II wird sich dem Library System von Dart sowie der asynchronen Programmierung, der IO Programmierung, der DOM-Tree Programmierung, server- und clientseitiger Programmierung sowie der Konvertierung von Datenformaten widmen.
Dies ist der zweite Teil der Tour de Dart. Der erste Teil hat die Sprache Dart an sich betrachtet. Dieser zweite Teil betrachtet erweiterte Aspekte wie:
Das Library System von Dart und den zugehörigen Paketmanager pub. Die asynchrone Programmierung mittels Streams, Futures und Isolates. File I/O mit Dart. Zugriff auf den DOM-Tree mittels Selektoren sowie Event Handling (Client side). Server und Client side Programmierung unter Nutzung von HttpServer, dem Dart webframework Start und Websockets. Datenkonvertierungen (HTML escaping, XSS prevention, decoding and encoding of JSON, base64 encoding and decoding, hashfunction (CryptoUtils)).
The document provides an introduction to the ConfD Database (CDB), which is a hierarchical, ACID-compliant database used by ConfD to store configuration and operational data modeled with YANG. CDB stores data both in-memory and persistently on disk, supports transactions, replication, and automatic schema upgrades. Managed objects use CDB APIs to read configuration data at startup and subscribe to relevant configuration changes via a subscription socket.
The document provides a summary of the candidate's career objective and experience. They have over 10 years of experience in telecom engineering roles, working on projects for companies like Nokia, Samsung, and Mobily. Their experience includes roles like USF9 Coordinator, Help Desk Team Lead, RAN Engineer, and Field Engineer. They have expertise in technologies like 2G, 3G, 4G LTE, WiMax and microwave links. The candidate is currently seeking a challenging career opportunity to allow for vertical growth.
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...Nane Kratzke
Elastic container platforms (like Kubernetes, Docker Swarm, Apache Mesos) fit very well with existing cloud-native application architecture approaches. So it is more than astonishing, that these already existing and open source available elastic platforms are not considered more consequently for multi-cloud approaches. Elastic container platforms provide inherent multi-cloud support that can be easily accessed. We present a solution proposal of a control process which is able to scale (and migrate as a side effect) elastic container platforms across different public and private cloud-service providers. This control loop can be used in an execution phase of self-adaptive auto-scaling MAPE loops (monitoring, analysis, planning, execution). Additionally, we present several lessons learned from our prototype implementation which might be of general interest for researchers and practitioners. For instance, to describe only the intended state of an elastic platform and let a single control process take care to reach this intended state is far less complex than to define plenty of specific and necessary multi-cloud aware workflows to deploy, migrate, terminate, scale up and scale down elastic platforms or applications.
El documento presenta una lista de bolígrafos de diferentes materiales como plástico, papel, madera y bambú. Se describen 18 bolígrafos con detalles como el material, medidas, cantidad de producción y código de modelo. El documento también incluye información sobre plumones, lápices y juegos de bolígrafos.
Diego Ricol Freyre ofrece varias casas en venta, incluyendo una casa de dos dormitorios con patio trasero en un barrio tranquilo por $150,000, y una casa de tres dormitorios con garaje en el centro de la ciudad por $200,000.
Tenerife is the largest of Spain's Canary Islands located off the northwest coast of Africa. It was formed by volcanic activity and was originally inhabited by the Guanche people. It has a predominantly Roman Catholic population and culture centered around family, carnivals, festivals, and laidback lifestyles. The economy relies heavily on tourism. Business culture places high importance on relationships and face-to-face contact. Both Spain and America hold stereotypes about each other's cultures.
Pinnacle Property Finders oversees property development and investment projects from start to finish. They have experience with developing luxury homes, apartments, and villas across the UK and Spain. Pinnacle handles all aspects of development including purchasing land, managing construction, obtaining permits, and marketing/selling the finished properties. Their past projects demonstrate profit yields ranging from 27% to over 70%. Pinnacle aims to deliver high quality finishes and maximize profits for their clients on each development.
This document provides information about PVC windows manufactured by Deyplasa, including:
- Deyplasa has over 35 years of experience in manufacturing PVC and aluminum windows and was the first Santander-based company to produce PVC windows.
- They produce windows under the Decanor brand which offers energy efficiency, soundproofing, durability, and variety of designs.
- The document goes on to describe how a Decanor PVC window is constructed, with details on the frame, leaf, seals, reinforcements, glass stops, and glazing. It also lists the different types of windows including fixed, casement, hopper, and turn and tilt.
Stuck and Frustrated or In Flow and Happy: Sensing Developers’ Emotions and P...s-mueller
Software developers working on change tasks commonly experience a broad range of emotions, ranging from happiness all the way to frustration and anger. Research, primarily in psychology, has shown that for certain kinds of tasks, emotions correlate with progress and that biometric measures, such as electro-dermal activity and electroencephalography data, might be used to distinguish between emotions. In our research, we are building on this work and investigate developers’ emotions, progress and the use of biometric measures to classify them in the context of software change tasks. We conducted a lab study with 17 participants working on two change tasks each. Participants were wearing three biometric sensors and had to periodically assess their emotions and progress. The results show that the wide range of emotions experienced by developers is correlated with their perceived progress on the change tasks. Our analysis also shows that we can build a classifier to distinguish between positive and negative emotions in 71.36% and between low and high progress in 67.70% of all cases. These results open up opportunities for improving a developer’s productivity. For instance, one could use such a classifier for providing recommendations at opportune moments when a developer is stuck and making no progress.
El documento habla sobre la asamblea federal de la Federación Española de Asociaciones de Scouts y Guías Adultos a la que asistió formando parte de la delegación madrileña. En la asamblea, la edad media de los asistentes superaba los sesenta años. Además, el autor conoció personas que hoy considera amigas y aprendió sobre el significado de ser scout adulto. La federación ha crecido imparablemente con actividades federales y un equipo directivo.
El documento habla de varios temas de forma breve y desordenada, incluyendo las Navidades, secretos ocultos de integrantes de una radio, no tener fotos de cuando era niño, cocido para comer, ser aburrido sin ordenador, disfrutar de poder copiar, historietas, ser un guerrero con antifaz, intentar algo, la belleza del mundo y los zapatos, concentrado de estricnina, presupuesto de una organización, falta de bebida, libertad, disfrutar de ser solista musical sin que nadie se mueva, lo
Troy Petteway is a retired US Navy Master Explosive Ordnance Disposal Technician seeking new employment. He has over 20 years of experience in explosive ordnance disposal and electronic countermeasures. Petteway holds a TS/SCI security clearance and certifications in training and curriculum development. He provides his resume and contact information and is interested in opportunities requiring his expertise in explosive ordnance disposal and electronic warfare.
Buy the Honeywell Access OKP0N26 from JMAC Supply.
https://www.jmac.com/Honeywell_Access_OKP0N26_p/honeywell-access-okp0n26.htm?=slideshare
El capítulo piloto presenta a Joel, un adolescente con habilidades extraordinarias como la telequinesis. También presenta a su compañero de piso Hugo, un mujeriego empedernido. La trama sigue a Joel mientras navega por su día a día, recuerda eventos pasados que muestran sus habilidades, e interactúa con Hugo, quien le cuenta sobre sus conquistas recientes.
Curso básico de posicionamiento SEO en el que se comentan los elementos más importantes para que tus páginas ocupen una buena posición en los buscadores
La exposición fotográfica presenta imágenes de la región de Madrid tomadas por Fernando Manso durante un año, buscando capturar la belleza a través de los cielos, la luz y la atmósfera. Manso pasó hasta 18 días esperando las condiciones de luz adecuadas para cada foto, retratando paisajes conocidos desde una nueva perspectiva e intentando evitar clichés. El resultado es una colección de fotos que muestran la naturaleza y lugares emblemáticos de Madrid de una manera pura y art
The document outlines Aaron McDowell's goals and strategies for various areas of instructional design and technology. It includes 14 sections that each contain a goal and 3 strategies to achieve that goal in areas such as mastery, learner engagement, visual communication, corporate training, evaluation, digital media, audio/music, filmmaking, games, learning management systems, media creation, and a final project. The overall goals are for Aaron to gain expertise in instructional design through resources on Lynda.com, YouTube, and academic articles.
esden ha realizado un importante esfuerzo a la hora de diseñar el programa de este Master, con el fin de ofrecer una formación lo más adecuada posible a las necesidades de los participantes.
Se trata de un Master eminentemente práctico a través del cual se pretende dotar a los participantes de los conocimientos necesarios para afrontar el día a día de la comunicación de una empresa, una institución o desde la perspectiva de una agencia.
Para ello, se contará con un claustro de profesores formado por profesionales del sector que aportarán todos sus conocimientos y experiencia.
The document provides information about Ajay Dhawan Group, an advertising company operating in India since 1992. It details the company's network of 10 national and 3 international offices, 400 employees across India, and capabilities in various advertising mediums. The CEO, Ajay Dhawan, has over 20 years of experience in out-of-home advertising and has grown the company from a small startup to a 200 person organization.
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...Nane Kratzke
Elastic container platforms (like Kubernetes, Docker Swarm, Apache Mesos) fit very well with existing cloud-native application architecture approaches. So it is more than astonishing, that these already existing and open source available elastic platforms are not considered more consequently for multi-cloud approaches. Elastic container platforms provide inherent multi-cloud support that can be easily accessed. We present a solution proposal of a control process which is able to scale (and migrate as a side effect) elastic container platforms across different public and private cloud-service providers. This control loop can be used in an execution phase of self-adaptive auto-scaling MAPE loops (monitoring, analysis, planning, execution). Additionally, we present several lessons learned from our prototype implementation which might be of general interest for researchers and practitioners. For instance, to describe only the intended state of an elastic platform and let a single control process take care to reach this intended state is far less complex than to define plenty of specific and necessary multi-cloud aware workflows to deploy, migrate, terminate, scale up and scale down elastic platforms or applications.
El documento presenta una lista de bolígrafos de diferentes materiales como plástico, papel, madera y bambú. Se describen 18 bolígrafos con detalles como el material, medidas, cantidad de producción y código de modelo. El documento también incluye información sobre plumones, lápices y juegos de bolígrafos.
Diego Ricol Freyre ofrece varias casas en venta, incluyendo una casa de dos dormitorios con patio trasero en un barrio tranquilo por $150,000, y una casa de tres dormitorios con garaje en el centro de la ciudad por $200,000.
Tenerife is the largest of Spain's Canary Islands located off the northwest coast of Africa. It was formed by volcanic activity and was originally inhabited by the Guanche people. It has a predominantly Roman Catholic population and culture centered around family, carnivals, festivals, and laidback lifestyles. The economy relies heavily on tourism. Business culture places high importance on relationships and face-to-face contact. Both Spain and America hold stereotypes about each other's cultures.
Pinnacle Property Finders oversees property development and investment projects from start to finish. They have experience with developing luxury homes, apartments, and villas across the UK and Spain. Pinnacle handles all aspects of development including purchasing land, managing construction, obtaining permits, and marketing/selling the finished properties. Their past projects demonstrate profit yields ranging from 27% to over 70%. Pinnacle aims to deliver high quality finishes and maximize profits for their clients on each development.
This document provides information about PVC windows manufactured by Deyplasa, including:
- Deyplasa has over 35 years of experience in manufacturing PVC and aluminum windows and was the first Santander-based company to produce PVC windows.
- They produce windows under the Decanor brand which offers energy efficiency, soundproofing, durability, and variety of designs.
- The document goes on to describe how a Decanor PVC window is constructed, with details on the frame, leaf, seals, reinforcements, glass stops, and glazing. It also lists the different types of windows including fixed, casement, hopper, and turn and tilt.
Stuck and Frustrated or In Flow and Happy: Sensing Developers’ Emotions and P...s-mueller
Software developers working on change tasks commonly experience a broad range of emotions, ranging from happiness all the way to frustration and anger. Research, primarily in psychology, has shown that for certain kinds of tasks, emotions correlate with progress and that biometric measures, such as electro-dermal activity and electroencephalography data, might be used to distinguish between emotions. In our research, we are building on this work and investigate developers’ emotions, progress and the use of biometric measures to classify them in the context of software change tasks. We conducted a lab study with 17 participants working on two change tasks each. Participants were wearing three biometric sensors and had to periodically assess their emotions and progress. The results show that the wide range of emotions experienced by developers is correlated with their perceived progress on the change tasks. Our analysis also shows that we can build a classifier to distinguish between positive and negative emotions in 71.36% and between low and high progress in 67.70% of all cases. These results open up opportunities for improving a developer’s productivity. For instance, one could use such a classifier for providing recommendations at opportune moments when a developer is stuck and making no progress.
El documento habla sobre la asamblea federal de la Federación Española de Asociaciones de Scouts y Guías Adultos a la que asistió formando parte de la delegación madrileña. En la asamblea, la edad media de los asistentes superaba los sesenta años. Además, el autor conoció personas que hoy considera amigas y aprendió sobre el significado de ser scout adulto. La federación ha crecido imparablemente con actividades federales y un equipo directivo.
El documento habla de varios temas de forma breve y desordenada, incluyendo las Navidades, secretos ocultos de integrantes de una radio, no tener fotos de cuando era niño, cocido para comer, ser aburrido sin ordenador, disfrutar de poder copiar, historietas, ser un guerrero con antifaz, intentar algo, la belleza del mundo y los zapatos, concentrado de estricnina, presupuesto de una organización, falta de bebida, libertad, disfrutar de ser solista musical sin que nadie se mueva, lo
Troy Petteway is a retired US Navy Master Explosive Ordnance Disposal Technician seeking new employment. He has over 20 years of experience in explosive ordnance disposal and electronic countermeasures. Petteway holds a TS/SCI security clearance and certifications in training and curriculum development. He provides his resume and contact information and is interested in opportunities requiring his expertise in explosive ordnance disposal and electronic warfare.
Buy the Honeywell Access OKP0N26 from JMAC Supply.
https://www.jmac.com/Honeywell_Access_OKP0N26_p/honeywell-access-okp0n26.htm?=slideshare
El capítulo piloto presenta a Joel, un adolescente con habilidades extraordinarias como la telequinesis. También presenta a su compañero de piso Hugo, un mujeriego empedernido. La trama sigue a Joel mientras navega por su día a día, recuerda eventos pasados que muestran sus habilidades, e interactúa con Hugo, quien le cuenta sobre sus conquistas recientes.
Curso básico de posicionamiento SEO en el que se comentan los elementos más importantes para que tus páginas ocupen una buena posición en los buscadores
La exposición fotográfica presenta imágenes de la región de Madrid tomadas por Fernando Manso durante un año, buscando capturar la belleza a través de los cielos, la luz y la atmósfera. Manso pasó hasta 18 días esperando las condiciones de luz adecuadas para cada foto, retratando paisajes conocidos desde una nueva perspectiva e intentando evitar clichés. El resultado es una colección de fotos que muestran la naturaleza y lugares emblemáticos de Madrid de una manera pura y art
The document outlines Aaron McDowell's goals and strategies for various areas of instructional design and technology. It includes 14 sections that each contain a goal and 3 strategies to achieve that goal in areas such as mastery, learner engagement, visual communication, corporate training, evaluation, digital media, audio/music, filmmaking, games, learning management systems, media creation, and a final project. The overall goals are for Aaron to gain expertise in instructional design through resources on Lynda.com, YouTube, and academic articles.
esden ha realizado un importante esfuerzo a la hora de diseñar el programa de este Master, con el fin de ofrecer una formación lo más adecuada posible a las necesidades de los participantes.
Se trata de un Master eminentemente práctico a través del cual se pretende dotar a los participantes de los conocimientos necesarios para afrontar el día a día de la comunicación de una empresa, una institución o desde la perspectiva de una agencia.
Para ello, se contará con un claustro de profesores formado por profesionales del sector que aportarán todos sus conocimientos y experiencia.
The document provides information about Ajay Dhawan Group, an advertising company operating in India since 1992. It details the company's network of 10 national and 3 international offices, 400 employees across India, and capabilities in various advertising mediums. The CEO, Ajay Dhawan, has over 20 years of experience in out-of-home advertising and has grown the company from a small startup to a 200 person organization.
Die Ringvorlesung "Informatik in der Praxis: Wirtschaft und Industrie" 2012 bringt die regionale IT-Wirtschaft mit Masterstudenten der Informatik und Wirtschaftsinformatik durch Zusammenarbeit in konkreten Praxisprojekten direkt zusammen. Das Community Management ITmitte.de organisiert diese Veranstaltung und begleitet sie kommunikativ.
Lassen Sie sich empfehlen zu über 100 IT, Informatik, Software - Jobs, Stellen, Praktika, Ausbildungen in Leipzig, Halle, Jena, Bitterfeld-Wolfen, Leuna, Zeitz, Gera, Zwickau, Plauen, Erfurt und Magdeburg.
Big Data verspricht den Unternehmen die 360°-Sicht auf ihre Kunden, indem die Analyse von Daten aus verschiedensten Kanälen möglich werden soll. Insbesondere in den sozialen Medien entstehen große Mengen an Text, Video und Audio. Doch wie lassen sich aus diesen "Unstructured Data" verwertbare Informationen gewinnen? Apache UIMA ist ein Framework zur Verarbeitung und inhaltlichen Analyse unstrukturierter Daten, insbesondere Text.
Dieser Vortrag bietet eine Einführung in Apache UIMA und seine Architektur. Am Beispiel wird erklärt, welche Annotationskomponenten zur Verfügung stehen und wie diese zu Pipelines kombiniert werden können. Außerdem wird eine Integration von UIMA mit Hadoop gezeigt.
Speaker: Hans-Peter Zorn
ist Big Data Scientist bei der inovex GmbH. Zuvor beschäftigte er sich am UKP Labder TU Darmstadt mit der Analyse großer Textmengen mit Hadoop.
Mehr Vorträge: https://www.inovex.de/de/content-pool/vortraege/
Webtechnologien Grundlagen und Auswahl geeigneter Web Rahmenwerkeadoubleu
Innerhalb dieser Vorlesung werden die Grundlagen der im Web verwendeten Technologien gezeigt. Anhand von Use Cases wird gezeigt, wie man kleine Webanwendungen erstellt und wie sich diese von umfangreichen Webanwendungen auf Basis von Webrahmenwerken wie z.b. Apache Wicket oder Google Web Toolkit unterscheiden.
Making the internet faster HTTP/3 und QUICQAware GmbH
Linux-Stammtisch, Making the internet faster HTTP/3 und QUIC, 27. Juli 2021, online: Vortrag von Franz Wimmer, (@zalintyre, Senior Software Engineer bei QAware)
== Bitte Folien herunterladen, falls sie unscharf sein sollten! =
Abstract:
Mit QUIC und HTTP/3 das Internet beschleunigen. Erfahre mehr über die Entwicklung des WWW, Benchmarks und die Implementierung von HTTP/3.
Smart like a Fox: How clever students trick dumb programming assignment asses...Nane Kratzke
This case study reports on two first-semester programming courses with more than 190 students. Both courses made use of automated assessments. We observed how students trick these systems by analysing the version history of suspect submissions. By analysing more than 3300 submissions, we revealed four astonishingly simple tricks (overfitting, evasion) and cheat-patterns (redirection, and injection) that students used to trick automated programming assignment assessment systems (APAAS). Although not the main focus of this study, it discusses and proposes corresponding counter-measures where appropriate.
Nevertheless, the primary intent of this paper is to raise problem awareness and to identify and systematise observable problem patterns in a more formal approach. The identified immaturity of existing APAAS solutions might have implications for courses that rely deeply on automation like MOOCs. Therefore, we conclude to look at APAAS solutions much more from a security point of view (code injection). Moreover, we identify the need to evolve existing unit testing frameworks into more evaluation-oriented teaching solutions that provide better trick and cheat detection capabilities and differentiated grading support.
#BTW17 on Twitter (Die Bundestagswahl 2017 auf Twitter - war der Ausgang abzu...Nane Kratzke
Es gibt erstaunlich wenig Open Access Twitter-Datensätze . Daher wurden von Juni bis September 2017 Twitter-Interaktionen mit 364 deutschen Politikern des deutschen Bundestags "mitgeschnitten" und als Open Data Datensatz für weitere Analysen aufbereitet. Im Rahmen dessen wurden etwa 120.000 Twitter User erfasst, die gemeinsam über 1.2 Mio. Twitterinteraktionen erzeugt haben. Der Vortrag stellt den Datensatz und seine Erhebungsmethode vor und geht einigen Fragen nach: Z.B. ob es "laute" und "leise" Parteien auf Twitter gibt? Ob und wie sich die politische Nähe von Twitter Nutzern zu Parteien ableiten lässt? Ob sich Twitter als Instrument für die Meinungsforschung eignet und was zu berücksichtigen ist? Und vor allem: War das Wahlergebnis bereits im Vorfeld absehbar?
About being the Tortoise or the Hare? Making Cloud Applications too Fast and ...Nane Kratzke
Cloud applications expose - beside service endpoints - also potential or actual vulnerabilities. And attackers have several advantages on their side. They can select the weapons, the point of time and the point of attack.
Very often cloud application security engineering efforts focus to harden the fortress walls but seldom assume that attacks may be successful. So, cloud applications rely on their defensive walls but seldom attack intruders actively. Biological systems are different. They accept that defensive "walls" can be breached at several layers and therefore make use of an active and adaptive defense system to attack potential intruders - an immune system. This position paper proposes such an immune system inspired approach to ensure that even undetected intruders can be purged out of cloud applications. This makes it much harder for intruders to maintain a presence on victim systems. Evaluation experiments with popular cloud service infrastructures (Amazon Web Services, Google Compute Engine, Azure and OpenStack) showed that this could minimize the undetected acting period of intruders down to minutes.
Serverless Architectures - Where have all the servers gone?Nane Kratzke
Serverless architectures refer to cloud applications that depend substantially on 3rd party services (Backend as a Service, BaaS)
or on custom code that is run in ephemeral deployment units (Function as a Service, FaaS). By moving much behavior to the front end, such architectures reduce the need for ‚always on‘ servers. Therefore, such systems can reduce operational cost and shift operational complexity to BaaS service providers at cost of vendor dependencies and (still) immaturity of supporting services and tools.
This presentation explains the term "Serverless" and how it is changing cloud application architectures. It identifies open issues, benefits and drawbacks, as well as (in-)appropriate use cases for Serverless. It closes with a curated list of Serverless services, standalone platforms and frameworks and provides a list for further reading.
There is no impenetrable system - So, why we are still waiting to get breached?Nane Kratzke
This is some input for a panel discussion about "Security and Safety in Cloud-based Systems and Services" (9th International Conference on Cloud Computing, GRIDs, and Virtualization (CLOUD COMPUTING 2018) in Barcelona, Spain in February 2018).
Although it might be hard to accept. By principle, attackers can establish footholds in our systems whenever they want (zero-day exploits). Cloud application security engineering efforts focus to harden the "fortress walls". Therefore, cloud applications rely on these defensive walls but seldom attack intruders actively. There is the somehow the need for a more reactive component. A component that could be inspired by biological systems. Biological systems consider by design that defensive "walls" can be breached at several layers. So, biological systems provide an additional active defense system to attack potential successful intruders - an immune system. Although several experts find this approach "intriguing", there are follow-up questions arising. What is about exploits that adapt to bio-inspired systems? How to protect the immune system against direct attacks? Are cloud immune systems prone to phenomenons like fever (running hot) or auto-immune diseases (self-attacking)?
Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...Nane Kratzke
The document discusses a proposed lightweight multi-cloud domain-specific language (DSL) for defining elastic and transferable cloud-native applications. It begins by outlining the research context and motivation to avoid vendor lock-in and make applications portable across different cloud infrastructures. The presentation then describes requirements for a cloud programming language, including supporting containerized deployments, application scaling, lightweight definitions, multi-cloud operations, and infrastructure independence. It proposes a core DSL model and shows how it can be made platform agnostic. An evaluation demonstrates deploying an application to different clouds and runtime environments and transferring it between infrastructures. The DSL is found to fulfill the intended requirements within the limitations of its scope.
We have the Bricks to Build Cloud-native Cathedrals - But do we have the mortar?Nane Kratzke
This is some input for a panel discussion about "Challenges of Cloud Computing-based Systems" I attend at the 9th International Conference on Cloud Computing, GRIDs, and Virtualization (CLOUD COMPUTING 2018) in Barcelona, Spain in February 2018.
Cloud-native applications (CNA) are build more and more often according to microservice and independent system architecture (ISA) approaches. ISA involves two architecture layers: the macro and the micro architecture layer. Software engineering outcomes on the micro layer are often distributed in a standardized form as self-contained deployment units (so called container images). There exist plenty of programming languages to implement these units: JAVA, C, C++, JavaScript, Python, R, PHP, Ruby, ... (this list is almost endless) But on the macro layer, one might mention TOSCA and little more. TOSCA is an OASIS deployment and orchestration standard language to describe a topology of cloud based web services, their components, relationships, and the processes that manage them. This works for static deployments. However, CNA are elastic, self-adaptive - almost the exact opposite of what can be defined efficiently using TOSCA. For these kind of scenarios one might mention Kubernetes or Docker Swarm as container orchestrators which are intentionally build to operate elastic services formed of containers. But these operating platforms do not provide expressive and pragmatic programming languages covering the macro layer of cloud-native applications.
So it seems there is a gap and the question arises, whether we need further (and what kind of) macro layer languages for CNA?
About an Immune System Understanding for Cloud-native Applications - Biology ...Nane Kratzke
Presentation for 9th International Conference on Cloud Computing, GRIDS, and Virtualization (CLOUD COMPUTING 2018) in Barcelona, Spain, 2018.
There is no such thing as an impenetrable system, although the penetration of systems does get harder from year to year. The median days that intruders remained undetected on victim systems dropped from 416 days in 2010 down to 99 in 2016. Perhaps because of that, a new trend in security breaches is to compromise the forensic trail to allow the intruder to remain undetected for longer in victim systems and to retain valuable footholds for as long as possible. This paper proposes an immune system inspired solution which uses a more frequent regeneration of cloud application nodes to ensure that undetected compromised nodes can be purged. This makes it much harder for intruders to maintain a presence on victim systems. Basically the biological concept of cell-regeneration is combined with the information systems concept of append-only logs. Evaluation experiments performed on popular cloud service infrastructures (Amazon Web Services, Google Compute Engine, Azure and OpenStack) have shown that between 6 and 40 nodes of elastic container platforms can be regenerated per hour. Even a large cluster of 400 nodes could be regenerated in somewhere between 9 and 66 hours. So, regeneration shows the potential to reduce the foothold of undetected intruders from months to just hours.
Der Bundestagswahlkampf 2017 auf Twitter - War der Ausgang abzusehen?Nane Kratzke
Von Juni bis September wurden Twitter-Interaktionen mit deutschen Politikern des 18. deutschen Bundestags und bundespolitisch relevanten Politikern der FDP und AfD "mitgeschnitten" und als Open Data Datensatz für weitere Analysen aufbereitet. Insgesamt wurden die Accounts von 364 Politikern verfolgt. Im Rahmen dessen wurden etwa 120.000 Twitter User erfasst, die gemeinsam über 1.2 Mio. Tweets erzeugt haben. Dies entspricht einer Stichprobe von etwa 5% des tatsächlichen Traffics auf Twitter. Die Gesamtmenge der erfassten Daten beträgt ca. 10 GB. Der Vortrag stellt erste Erkenntnisse vor, die in diesem Datensatz zu finden sind. Dabei wird einigen Fragen nachgegangen, z.B. ob es "laute" und "leise" Parteien auf Twitter gibt? Lässt sich die politische Nähe von Twitter Nutzern zu Parteien ableiten? Eignet sich Twitter als Instrument für die Meinungsforschung? Und vor allem: War das Wahlergebnis bereits im Vorfeld absehbar?
Was die Cloud mit einem brennenden Haus zu tun hatNane Kratzke
Ein Motivationsvortrag für hybride Cloud Szenarien im Rahmen einer Veranstaltung des Computermuseums der FH Kiel und der fat it solution GmbH.
Der Vortrag beschäftigt sich mit häufig genannten Bedenken warum Cloud-basierte Geschäftsmodelle vermieden werden: Verfügbarkeit, Sicherheit, Vendor Lock-In (Fokus dieses Vortrags), Kosten.
Und was man dagegen machen kann.
What the cloud has to do with a burning house?Nane Kratzke
Cloud native applications can create enormous business growth and value in a very short amount of time. Take Instagram as one example company. It took only two years to get a net asset value of 1 billion USD. However, cloud-native applications are often characterized by a highly implicit technological dependency on hosting cloud infrastructures. What happens if you are forced to leave your cloud service provider? What happens if your cloud is burning? The project Cloud TRANSIT investigates how to design cloud-native applications and services to reduce technological dependencies on underlying cloud infrastructures.
ClouNS - A Cloud-native Application Reference Model for Enterprise ArchitectsNane Kratzke
The capability to operate cloud-native applications can create enormous business growth and value. But enterprise architects should be aware that cloud-native applications are vulnerable to vendor lock-in. We investigated cloud-native application design principles, public cloud service providers, and industrial cloud standards. All results indicate that most cloud service categories seem to foster vendor lock-in situations which might be especially problematic for enterprise architectures. This might sound disillusioning at first. However, we present a reference model for cloud-native applications that relies only on a small subset of well standardized IaaS services. The reference model can be used for codifying cloud technologies. It can guide technology identification, classification, adoption, research and development processes for cloud-native application and for vendor lock-in aware enterprise architecture engineering methodologies.
ppbench - A Visualizing Network Benchmark for MicroservicesNane Kratzke
Companies like Netflix, Google, Amazon, Twitter successfully exemplified elastic and scalable microservice architectures for very large systems. Microservice architectures are often realized in a way to deploy services as containers on container clusters. Containerized microservices often use lightweight and REST-based mechanisms. However, this lightweight communication is often routed by container clusters through heavyweight software defined networks (SDN). Services are often implemented in different programming languages adding additional complexity to a system, which might end in decreased performance. Astonishingly it is quite complex to figure out these impacts in the upfront of a microservice design process due to missing and specialized benchmarks. This contribution proposes a benchmark intentionally designed for this microservice setting. We advocate that it is more useful to reflect fundamental design decisions and their performance impacts in the upfront of a microservice architecture development and not in the aftermath. We present some findings regarding performance impacts of some TIOBE TOP 50 programming languages (Go, Java, Ruby, Dart), containers (Docker as type representative) and SDN solutions (Weave as type representative).
About Microservices, Containers and their Underestimated Impact on Network Pe...Nane Kratzke
Microservices are used to build complex applications composed of small, independent and highly decoupled processes. Recently, microservices are often mentioned in one breath with container technologies like Docker. That is why operating system virtualization experiences a renaissance in cloud computing. These approaches shall provide horizontally scalable, easily deployable systems and a high-performance alternative to hypervisors. Nevertheless, performance impacts of containers on top of hypervisors are hardly investigated. Furthermore, microservice frameworks often come along with software defined networks. This contribution presents benchmark results to quantify the impacts of container, software defined networking and encryption on network performance. Even containers, although postulated to be lightweight, show a noteworthy impact to network performance. These impacts can be minimized on several system layers. Some design recommendations for cloud deployed systems following the microservice architecture pattern are derived.
Mit Java 8 haben endlich Lambdas in den Sprachumfang von Java Einzug gehalten. Mittels Lambdas lassen sich viele Probleme kurz und prägnant ausdrücken. Vorliegende Auskopplung aus Handouts zur Vorlesung Programmieren I führt Lambdas und Streams ein und erläutert den Einsatz an vielen kleineren Beispielen.
Cloud Economics in Training and SimulationNane Kratzke
This slide presents a use case how to adopt IaaS cloud computing in higher education. It is shown that virtual labs can provide a more than 25 times cost advantage compared to classical dedicated on-premise in-house labs.
Are cloud based virtual labs cost effective? (CSEDU 2012)Nane Kratzke
Cost efficiency is an often mentioned strength of cloud computing. In times of decreasing educational budgets virtual labs provided by cloud computing might be an interesting alternative for higher education organizations or IT training facilities. This contribution analyzes the cost advantage of virtual educational labs provided via cloud computing means and compare these costs to costs of classical ed- ucational labs provided in a dedicated manner. This contribution develops a four step decision making model which might be interesting for colleges, universities or other IT training facilities planning to implement cloud based training facilities. Furthermore this contribution provides interesting findings when cloud computing has economical advantages in education and when not. The developed four step decision making model of general IaaS applicability can be used to find out whether an IaaS cloud based virtual IT lab approach is more cost efficient than a dedicated approach.
A Case Study About Cloud Based Virtual Labs
Poster presentation on 2nd International Conference on Cloud Computing and Service Sciences (CLOSER 2012).
Case study about cloud based virtual labs and corresponding cost advantage in higher education.
Overcoming Cost Intransparency of Cloud ComputingNane Kratzke
Presentation hold during Cloud Computing Conference 2011 in Noordwijkerhout, Netherlands 2011. This is presentation is about missing cost estimation models in cloud computing and presents firsts considerations how to overcome this.
Overcoming Cost Intransparency of Cloud ComputingNane Kratzke
Anzeige
RESTful APIs mit Dart
1. Web-Technologien
Hypertext Transfer Protocol (HTTP)
Representational State Transfer (REST)
Vorlesung
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
1
2. Prof. Dr. rer. nat.
Nane Kratzke
Praktische Informatik und
betriebliche Informationssysteme
• Raum: 17-0.10
• Tel.: 0451 300 5549
• Email: [email protected]
• Sprechzeiten: Mi. 14:00 bis 16:00
(nach Mail-Voranmeldung, oder jederzeit
mit Termin)
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
2
3. Zum Nachlesen ...
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
3
Chapter 5:
Representational State Transfer (REST)
5.1 Deriving REST
5.2 REST Architectural Styles
5.3 REST Architectural Views
4. HTTP in a Nutshell ...
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
4
• Hypertext Transfer Protocol (HTTP) ist ein zustandsloses Protokoll
zur Übertragung von Daten auf der Anwendungsschicht.
• Es wird hauptsächlich eingesetzt, um Webseiten (HTML-
Dokumente) mit einem Webbrowser zu laden.
• Es ist jedoch nicht darauf beschränkt und kann auch als allgemeines
Datenprotokoll eingesetzt werden (siehe bspw. REST).
https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol
5. URI – Uniform Resource Identifier
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
5
Ein Uniform Resource Identifier (Abk. URI) ist ein Identifikator und besteht aus
einer Zeichenfolge, die zur Identifizierung einer Ressource (wie z.B. Webseiten,
Dateien, Webservices, E-Mail-Empfängern, etc.) dient.
Aus: Tanenbaum, van Steen; Verteilte Systeme; Pearson; Abb. 12.16 (Bsp. für URIs)
6. URL – Uniform Resource Locator
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
6
https://de.wikipedia.org/wiki/Uniform_Resource_Identifier
More
detailed
Ein Uniform Resource
Locator (Abk. URL) ist
eine spezielle Form einer
URI, die vor allem im
Webkontext gebräuchlich
ist.
7. Uri
https://api.dartlang.org/1.13.2/dart-core/Uri-class.html
URL – Uniform Resource Locator
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
7
Uri url = Uri.parse(
"http://example.com:992/animal/bird?species=seagul#wings"
);
print("Scheme: ${url.scheme}");
print("Authority: ${url.authority}");
print("Host: ${url.host}");
print("Port: ${url.port}");
print("Path: ${url.path}");
print("Query: ${url.query}");
print("Fragment: ${url.fragment}");
8. HTTP Request
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
8
GET POST HEAD PUT DELETE OPTIONS
9. HTTP Methoden
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
9
Aus: Tanenbaum, van Steen; Verteilte Systeme; Pearson; Abb. 12.11 (Von HTTP unterstützte
Operationen/Methoden; nicht vollständig, umfasst nur die häufigsten Operationen)
HTTP wurde als allgemein verwendbares Client-Server Protokoll entworfen. D.h.
Ressourcen lassen sich nicht nur lesend (GET) von einem Server anfordern (was im
Web sicherlich die am meisten verwendete Form ist, wenn man mit Webbrowsern
„surft“), sondern auch erzeugen (POST), verändern (PUT), löschen (DELETE) bzw. nur
Meta Informationen abrufen (HEAD).
Welche Methoden auf einer Ressource anwendbar sind, lässt sich mittels OPTIONS
herausfinden.
10. HTTPClientRequest
https://api.dartlang.org/1.13.2/dart-io/HttpClientRequest-class.html
HTTP Request
Erzeugen und Auswerten mit Dart
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
10
import 'dart:io';
[...]
final client = new HttpClient();
HttpClientRequest request =
await client.get('www.fh-luebeck.de', 80, '/index.html');
// Body schreiben
final body = "This is the message for the body";
request.contentLength = body.length;
request.write(body);
// Header
print("${request.method} ${request.uri}");
print(request.headers);
// Body
print("n$body");
Achtung:Wegendart:ionuralsKommandozeilenappund
nichtimBrowserlauffähig!FürBrowserbittedart:htmlund
HttpRequestnutzen.LeichtandereAPIberücksichtigen.
11. HTTP Request
(Ausgabe)
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
11
GET http://www.fh-luebeck.de/index.html
user-agent: Dart/1.13 (dart:io)
accept-encoding: gzip
content-length: 32
host: www.fh-luebeck.de
This is the message for the body
Vorherige Codezeilen würden folgende Konsolenausgabe erzeugen.
12. HTTP Request (Header Fields)
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
12
https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Aus:Tanenbaum,vanSteen;VerteilteSysteme;Pearson;Abb.12.13
(EinigeHTTP-Nachrichtenköpfe)
Über eine Reihe von
Headern kann der Client
dem Server mitteilen,
welche Arten von
Antworten er verarbeiten
kann.
Umgekehrt, kann der
Server dem Client über
Header mitteilen, welche
Art von Dokument
ausgeliefert wurde.
13. HTTP Response
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
13
14. Content Types
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
14
Aus: Tanenbaum, van Steen; Verteilte Systeme; Pearson; Abb. 12.2 (Sechs MIME-Typen der
allgemeinen Ebene und einige verbreitete Untertypen, es fehlt allerdings bspw.
application/json)
MIME =
Multipurpose
Internet Mail
Exchange
Ursprünglich für
Mail Protokolle
gedacht, wird aber
auch für Content-
Types bei HTTP
genutzt, um die Art
des Dokumentes in
der HTTP Response
anzugeben.
15. HTTPClientResponse
https://api.dartlang.org/1.13.2/dart-io/HttpClientResponse-class.html
HTTP Response
Erzeugen und Auswerten mit Dart
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
15
import 'dart:io';
import 'dart:convert‘;
[...]
final client = new HttpClient();
HttpClientRequest req =
await client.get('www.fh-luebeck.de', 80, '/index.html');
HttpClientResponse resp = await request.close();
// Response Header
print(
"${req.method} ${req.uri} ${resp.statusCode} ${resp.reasonPhrase}“
);
print("${resp.headers}");
print("");
// Response Body
final body = await resp.transform(UTF8.decoder).join("n");
print(body);
Achtung:Wegendart:ionuralsKommandozeilenappundnichtim
Browserlauffähig!FürBrowserbittedart:htmlundHttpRequest
nutzen.LeichtandereAPIberücksichtigen.
16. HTTP Response
(Ausgabe)
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
16
GET http://www.fh-luebeck.de/index.html 200 OK
x-powered-by: PHP/5.4.45-0+deb7u2
cache-control: max-age=0
date: Mon, 25 Jan 2016 08:20:36 GMT
vary: Accept-Encoding
content-encoding: gzip
content-length: 8572
content-type: text/html; charset=utf-8
server: Apache
expires: Mon, 25 Jan 2016 08:20:36 GMT
<!DOCTYPE html>
<html lang="de">
<head>
[...]
Vorherige Codezeilen, würden folgende Konsolenausgabe erzeugen.
17. HTTP Statuscodes
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
17
• 1xx Informationen
• 2xx Erfolgreiche Operation
• 3xx Umleitung (Redirect)
• 4xx Client Fehler (z.B. Bad
Request, Not Found)
• 5xx Server Fehler
Gute Übersicht gebräuchlicher HTTP
Statuscodes:
http://www.restapitutorial.com/httpstatuscodes.html
18. Zum Nachlesen ...
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
18
Chapter 5:
Representational State Transfer (REST)
5.1 Deriving REST
5.2 REST Architectural Styles
5.3 REST Architectural Views
19. REST in a Nutshell ...
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
19
• Representational State Transfer (REST) ist ein Architekturstil für
verteilte Systeme auf Basis von HTTP
• REST APIs dienen primär der Maschine-Maschine-Kommunikation
• REST ist eine Alternative zu ähnlichen Ansätzen wie SOAP oder RPC
• REST Requests arbeiten auf Ressourcen (anders als bspw. RPC)
• Client und Server können in anderen Sprachen realisiert sein (language
agnostic)
• REST Responses nutzen daher gerne sprachunabhängige
Serialisierungsformate wie bspw. JSON oder XML
• Die für REST nötige Infrastruktur und Protokolle sind im WWW bereits
vorhanden
• Da das WWW (horizontal) skalierbar ist, sind es REST-basierte Systeme
zumeist auch (wenn man ein paar Dinge beachtet)
https://de.wikipedia.org/wiki/Representational_State_Transfer
20. Für REST benötigte HTTP Methoden
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
20
Methode Bedeutung Idempotent Sicher CRUD
POST Fügt eine neue
Ressource hinzu
create
GET Fordert eine
Ressource an
x x read
PUT Ändert eine
Ressource
x update
DELETE Löscht eine
Ressource
x delete
Sicher (safe): Eine Operation ändert nicht den Zustand
(nebeneffektsfreie Operation)
Idempotent: Wird eine Operation zweimal hintereinander ausgeführt,
ist die zweite Operation sicher (d.h. ändert nichts mehr am Zustand)
21. Same-Origin-Policy
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
21
Quelle: https://de.wikipedia.org/wiki/Same-Origin-Policy
Die Same-Origin-Policy (SOP) ist ein Sicherheitskonzept,
das clientseitigen Skriptsprachen untersagt, auf
Ressourcen zuzugreifen, deren Speicherort nicht
dem Origin entspricht. Sie stellt ein Sicherheitselement in
modernen Browsern zum Schutz vor Angriffen dar.
Hintergrund: Skriptsprachen im Browser haben Zugriff auf
Kommunikation zwischen Browser und Web-Server. Dies
beinhaltet sowohl das Auslesen, die Manipulation, das
Empfangen und Senden von Daten.
Daraus ergibt sich die Sicherheitsanforderung, dass
keine Daten aus einem Kontext (zum Beispiel der
Verbindung des Browsers zu der Seite einer Bank) von
einem Skript aus einem anderen Kontext zugreifbar oder
manipulierbar sein darf. Um dies zu erreichen, wird beim
Zugriff eines Skriptes auf eine Ressource die Herkunft
(origin) von beiden verglichen. Der Zugriff wird nur
erlaubt, wenn Skript und angeforderte Ressource
dieselbe Herkunft (origin) haben (vom selben Server
stammen).
22. Same Origin Definition
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
22
http://www.example.com/dir/page.html
Die Same-Origin-Policy (SOP) ist erfüllt, wenn bei zwei Ressourcen deren
URL-Anteile Scheme, Host und Port übereinstimmen.
Scheme Host Port Origin
23. SOP und REST vertragen sich nicht immer
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
23
Die Same-Origin-Policy (SOP) ist dann ggf. hinderlich, wenn von einem Server eine
Webapplikation geladen wird, die mit einem zweiten (nicht notwendig identischem)
Server eine z.B. REST-basierte Kommunikation aufbauen muss.
In solchen Fällen kann der HTTP Server, der follow up requests bearbeitet, seine
Responses mittels CORS Headers (Cross Origin Resource Sharing) kennzeichnen.
Der HTTP Client verzichtet dann auf eine Same Origin Prüfung.
24. CORS
Ermöglichen mit Dart
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
24
/**
* Sets CORS headers for HTTP responses.
*/
void enableCors(HttpResponse response) {
response.headers.add(
"Access-Control-Allow-Origin",
"*"
);
response.headers.add(
"Access-Control-Allow-Methods",
"POST, GET, DELETE, PUT, OPTIONS"
);
response.headers.add(
"Access-Control-Allow-Headers",
"Origin, Content-Type, Accept, Charset"
);
}
Cross-Origin Resource Sharing (CORS) ist ein Mechanismus, der Webclients Cross-
Origin-Requests ermöglicht. Die Einschränkungen, die durch die SOP auferlegt sind,
können vom Server aufgehoben werden. Der Server kann den Zugriff durch setzen
entsprechender Access-Control-Allow-* Response Header erlauben/einschränken.
25. Ein einfacher REST-basierter Hello World
Service
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
25
Methode Resource CRUD Beschreibung Beispiel
POST /greet/:lang Create Erzeugt einen neuen Gruß POST /greet/deutsch
greet=hallo%20welt
GET /greet/:lang Read Liest einen Gruß für Sprache :lang GET /greet/deutsch
PUT /greet/:lang Update Ändert einen Gruß für Sprache :lang PUT /greet/deutsch
Greet=Hallo%20Welt
DELETE /greet/:lang Delete Löscht den Gruß der Sprache :lang DELETE /greet/deutsch
GET /greets List Listet alle im Service gespeicherten
Grüße (Antwort als JSON Map)
GET /greets
Das REST-Prinzip soll exemplarisch an einem kleinen
Hello World Service demonstriert werden, der
mehrsprachige Gruß Ressourcen („Hello World“
Flosklen) verwaltet. Der Service soll um Grüße in
fremden Sprachen ergänzt werden, einen Gruß in einer
spezifischen Sprache ausgeben, Grüße bestehender
Sprachen ändern und löschen können. Ferner soll er
einen Überblick über alle hinterlegten Sprachen und
zugeordneten Grüße liefern können.
26. Ein einfacher REST Server in Dart
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
26
// A simple REST based Hello World service.
class Server {
// Service state. Default languages and greets (UTF-8 encoded!).
var greets = {
"dutch" : "Hello wereld",
"english" : "Hello world",
"french" : "Bonjour monde",
"german" : "Hallo Welt",
"italian" : "Ciao mondo",
"portuguese" : "Olá mundo",
"spanish" : "Hola mundo"
};
// Internally used for JSON pretty printing in JSON responses.
final json = new JsonEncoder.withIndent(' ');
// Resource Path definitions.
final greetUrl = new UrlPattern(r'/greet/(w+)'); // /greet/:lang
final greetsUrl = new UrlPattern(r'/greets'); // /greets
[...]
}
27. Ein einfacher REST Server in Dart
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
27
import 'dart:io';
import 'package:route/server.dart';
[...]
/**
* Starts the REST API server.
*/
Future<Router> serve({ip: '0.0.0.0', port: 4040}) async {
final server = await HttpServer.bind(ip, port);
final router = new Router(server)
..serve(greetUrl, method: 'OPTIONS').listen(optionsGreet)
..serve(greetUrl, method: 'POST' ).listen(createGreet)
..serve(greetUrl, method: 'GET' ).listen(readGreet)
..serve(greetUrl, method: 'PUT' ).listen(updateGreet)
..serve(greetUrl, method: 'DELETE' ).listen(deleteGreet)
..serve(greetsUrl, method: 'GET' ).listen(listGreets);
return new Future.value(router);
}
28. OPTIONS /greet/:lang
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
28
/**
* Handles OPTIONS /greet/:lang requests
* (used by the dart:html HttpRequest class).
* This is necessary to handle HTTP client behaviors
* (often an OPTIONS call is launched to determine
* whether a POST, DELETE, PUT call is allowed).
*/
void optionsGreet(HttpRequest req) {
HttpResponse res = req.response;
enableCors(res);
res.write("POST, GET, DELETE, PUT, OPTIONS");
res.close();
}
final router = new Router(server)
..serve(greetUrl, method: 'OPTIONS').listen(optionsGreet)
..serve(greetUrl, method: 'POST' ).listen(createGreet)
..serve(greetUrl, method: 'GET' ).listen(readGreet)
..serve(greetUrl, method: 'PUT' ).listen(updateGreet)
..serve(greetUrl, method: 'DELETE' ).listen(deleteGreet)
..serve(greetsUrl, method: 'GET' ).listen(listGreets);
Es gibt diverse HTTP Client
Libraries, die bei POST,
DELETE und PUT vorher
per OPTIONS anfragen, was
für Methoden auf einer
Ressource überhaupt
zulässig sind.
Es macht für diese Fälle
Sinn für jede Ressource
einen entsprechenden
OPTIONS Handler
vorzusehen, ansonsten
scheitert ein Request bereits
beim BITTE BITTE sagen.
29. POST /greet/:lang
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
29
/**
* Handles POST /greet/:lang requests to create a new language specific greet.
* Params: greet (greet in language :lang)
*/
void createGreet(HttpRequest req) {
HttpResponse res = req.response; // To be created response
enableCors(res); // set CORS headers
final lang = greetUrl.parse(req.uri.path).first; // Language part of path
req.transform(UTF8.decoder).join("n").then((body) { // req is stream (body)
final params = Uri.parse("?$body").queryParameters; // body contains params
if (greets.containsKey(lang)) { // lang already existing
res.statusCode = HttpStatus.CONFLICT; // 409
res.reasonPhrase = "Already existing";
res.close(); // Send response (error)
return;
}
if (!params.containsKey('greet')) { // no greet parameter
res.statusCode = HttpStatus.BAD_REQUEST; // 400
res.reasonPhrase = "Missing parameter";
res.close(); // Send response (error)
return;
}
greets[lang] = params['greet']; // Change server state
res.statusCode = HttpStatus.CREATED; // 201
res.close(); // Send response (succes)
});
}
greet=Hallo%20Welt
30. GET /greet/:lang
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
30
/**
* Handles GET /greet/:lang requests to read
* a language specific greet.
*/
void readGreet(HttpRequest req) {
HttpResponse res = req.response;
enableCors(res);
final lang = greetUrl.parse(req.uri.path).first;
if (!greets.containsKey(lang)) {
res.statusCode = HttpStatus.NOT_FOUND; // 404
res.reasonPhrase = "Not Found";
res.write("Not Found");
res.close(); // Send response (error)
return;
}
res.write(greets[lang]); // Read Status
res.close(); // Send response (success)
}
final router = new Router(server)
..serve(greetUrl, method: 'OPTIONS').listen(optionsGreet)
..serve(greetUrl, method: 'POST' ).listen(createGreet)
..serve(greetUrl, method: 'GET' ).listen(readGreet)
..serve(greetUrl, method: 'PUT' ).listen(updateGreet)
..serve(greetUrl, method: 'DELETE' ).listen(deleteGreet)
..serve(greetsUrl, method: 'GET' ).listen(listGreets);
31. DELETE /greet/:lang
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
31
/**
* Handles DELETE /greet/:lang requests to delete
* a language specific greet.
*/
void deleteGreet(HttpRequest req) {
HttpResponse res = req.response;
enableCors(res);
final lang = greetUrl.parse(req.uri.path).first;
greets.remove(lang); // Löschoperation
res.close();
}
final router = new Router(server)
..serve(greetUrl, method: 'OPTIONS').listen(optionsGreet)
..serve(greetUrl, method: 'POST' ).listen(createGreet)
..serve(greetUrl, method: 'GET' ).listen(readGreet)
..serve(greetUrl, method: 'PUT' ).listen(updateGreet)
..serve(greetUrl, method: 'DELETE' ).listen(deleteGreet)
..serve(greetsUrl, method: 'GET' ).listen(listGreets);
Eine DELETE Operation ist
idempotent. D.h.
wiederholte Löschung (bzw.
das löschen nicht existenter
Ressourcen) sollten nicht in
einem Fehler enden.
32. GET /greets
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
32
/**
* Handles GET /greets requests to list all
* language specific greets (JSON).
*/
void listGreets(HttpRequest req) {
HttpResponse res = req.response;
enableCors(res);
res.headers.contentType = new ContentType(
"application", "json", charset: 'UTF-8‘
);
res.write(json.convert(greets));
res.close();
}
final router = new Router(server)
..serve(greetUrl, method: 'OPTIONS').listen(optionsGreet)
..serve(greetUrl, method: 'POST' ).listen(createGreet)
..serve(greetUrl, method: 'GET' ).listen(readGreet)
..serve(greetUrl, method: 'PUT' ).listen(updateGreet)
..serve(greetUrl, method: 'DELETE' ).listen(deleteGreet)
..serve(greetsUrl, method: 'GET' ).listen(listGreets);
Liefert alle greets
Ressourcen.
33. Zusammenfassung
• HTTP
• Uniform Resource Identifiers (URI) und Locators (URL)
• HTTP Request (Client) und Response (Server)
• HTTP Methoden
• HTTP Header
• HTTP Content Types (MIME)
• HTTP Status Codes
• Dart Libraries für HTTP
• Same Origin Policy (SOP) und Cross Origin Resource
Sharing (CORS)
• REST
• CRUD und HTTP Methoden
• Sichere und idempotente Operationen
• REST am Bsp. eines Hello World Service
• Dart Libraries für REST
Prof. Dr. rer. nat. Nane Kratzke
Praktische Informatik und betriebliche Informationssysteme
33