SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Ada for Web Development
Stéphane Carrez AdaCore Tech Days
https://github.com/stcarrez/ada-awa 2
Web Application Architectures
● Legacy HTML web app
● Single page web app
Client Browser
API REST
Server
Back
End
DatabaseGET
HTML+JS
GET
JSON
Static
HTML
React JS
Vue.js
Client Browser Server
Front
End
Server
Back
End
Database
GET
HTML
https://github.com/stcarrez/ada-awa 3
Introducing Ada Web Application
● Project started in 2011 with already 6 releases
● Based on experience building SaaS application
(J2EE, Java Server Faces, Hibernate, OAuth2)
https://github.com/stcarrez/ada-awa 4
AWA Architecture
Ada Web Application
Ada Database
Objects
OpenAPI Ada
Ada
Server Faces
Ada Servlet
Ada WikiAda EL
Ada Security
Ada UtilAda Web Server XML/Ada
MySQL PostgreSQL SQLite
GNU/Linux WindowsFreeBSDNetBSD
Your Web Application
Dynamo
https://github.com/stcarrez/ada-awa 5
AWA Features
Comments Counters Votes Tags Changelogs
Users Jobs EventsMails
Wikis Storages ImagesBlogs Questions
General purpose components
System components
Functional components
Permissions
Settings Flotcharts Trumbowyg
SetupWorkspaces
https://github.com/stcarrez/ada-awa 6
AWA Request Flow
Servlet
Filter
Client
Server Faces
Servlet
AWS Module Database
Ada Bean
GET
Do_Filter
Do_Get
Set_Value
Get_Value
Load
https://github.com/stcarrez/ada-awa 7
Challenge: Database Access
Servlet
Filter
Client
Server Faces
Servlet
AWS Module Database
Ada Bean
GET
Do_Filter
Do_Get
Set_Value
Get_Value
Load
Access database content while
using Ada strong typing
https://github.com/stcarrez/ada-ado 8
Database Modeling
XML Model
Dynamo
Generator
Model
Doc
(HTML)
SQL
Tables
Ada
Model
Packages
UML Model
Ada Database
Objects Library
Generated Application Model Packages
Your Application Code
Ada Utility Library
Postgresql, MySQL or SQLite
Generate Develop
YAML Model
Design
https://github.com/stcarrez/ada-ado 9
Generated Ada Model
● Public object reference type with accessors
● Private implementation type holds the values
● Load, Save, Delete, Find operations
package AWA.Users.Model is
  type Status_Type is (INACTIVE, REGISTERING, ACTIVE);
  type Email_Ref is new ADO.Objects.Object_Ref with null record;
  type User_Ref is new ADO.Objects.Object_Ref with null record;
  procedure Set_Name (Object : in out User_Ref; Value : in String);
  function Get_Name (Object : in User_Ref) return String;
  overriding procedure Save (Object : in out User_Ref; ...);
...
private
  type Email_Impl is new ADO.Objects.Object_Record ...;
  type User_Impl is new ADO.Objects.Object_Record ...;
end AWA.Users.Model;
https://github.com/stcarrez/ada-ado 10
Using the Ada Model
● Declare T_Ref instances
● Use Get_X and Set_X to access attributes
● Use Load, Find to retrieve and Save, Delete to modify
  User  : User_Ref;
  Email : Email_Ref;
  User.Set_Name (“Ada Lovelace”);
  User.Set_Status (REGISTERING);
  User.Save (Session);
  ...
  Email.Set_Emailaddress (“ada@protonmail.com”);
  Email.Set_User (User);
  Email.Save (Session);
  User.Set_Email (Email);
  User.Set_Status (ACTIVE);
  User.Save (Session);
INSERT INTO user (id,object_version,name,
email,date,status) VALUES(?, ?, ?, ?, ?, ?)
INSERT INTO email (id,version,name,
emailAddress, user) VALUES(?, ?, ?, ?)
UPDATE user SET status = ?, email = ?
WHERE id = ? AND object_version = ?
https://github.com/stcarrez/ada-awa 11
Challenge: Access Control
Servlet
Filter
Client
Server Faces
Servlet
AWS Module Database
Ada Bean
GET
Do_Filter
Do_Get
Set_Value
Get_Value
Load
Authorize access
Data access permission checkPermission check in views:
Hide forbidden operations
https://github.com/stcarrez/ada-security 12
Ada Security:
Authenticate & Authorize
Security
Context
OpenID
Connect
Authenticate
Postgresql, MySQL or SQLite
[2.3] Check permission
[1.1] Authenticate
OAuth 2
[2.2] Ask authorization
Security Policy Manager
Postgresql, MySQL or SQLite
Users
ACL, Permissions
[2.4] Access granted
[2.4] Access denied
[1.2] create security context
Policy 1 Policy N
https://github.com/stcarrez/ada-awa 13
Challenge: Web Presentation
Servlet
Filter
Client
Server Faces
Servlet
AWS Module Database
Ada Bean
GET
Do_Filter
Do_Get
Set_Value
Get_Value
Load
Format user’s data in HTML page
Validate request parameters
https://github.com/stcarrez/ada-asf 14
Ada Server Faces (Java JSR 344)
● MVC web framework
● Render HTML, XML, JSON, Text,…, Ada
● Validate inputs
● Uses XML to describe views
https://github.com/stcarrez/ada-asf 15
Ada Server Faces
● Facelets: XHTML files with templating
● Component based interface
<f:metadata>
  <f:viewParam id=’page’ value=’#{wikiView.name}’/>
  <f:viewAction action='#{wikiView.load}'/>
</f:metadata>
<div>
  <awa:wiki value=”#{wikiView.content}”/>
</div>
<div class="wiki­page­footer">
  <h:outputFormat styleClass="wiki­page­date"
                  value="#{wikiMsg.wiki_page_info_date}">
    <f:param value="#{wikiView.date}"/>
    <f:converter converterId="smartDateConverter"/>
  </h:outputFormat>
</div>
Custom UI
component:
render wiki text
Operation called
before rendering
Standard UI
component with
custom format
https://github.com/stcarrez/ada-el 16
Ada EL (Java JSR 245)
● The presentation layer need values from Ada
objects
● EL is a simple but powerful expression language
● Java implements EL using introspection
● Implemented in Ada using limited interface
#{wikiView.title} type Wiki_View_Bean is ...
  Title : Unbounded_String;
  ...
end record;
EL expression Ada
https://github.com/stcarrez/ada-awa 17
Challenge: REST API
● Single page web app
Client Browser
API REST
Server
Back
End
DatabaseGET
HTML+JS
GET
JSON
Static
HTML
React JS
Vue.js
Expose well defined REST API
for Javascript frameworks
https://github.com/stcarrez/swagger-ada 18
OpenAPI Specification
● Started in 2010 to describe REST APIs
● OpenAPI Initiative created in Nov 5, 2015
(Google, Microsoft, IBM, Paypal, ...)
● OpenAPI 3.0 released July 26, 2017
● https://github.com/OAI/OpenAPI-Specification
https://github.com/stcarrez/swagger-ada 19
Swagger/OpenAPI Tools
OpenAPI
Document
YAML
JSON{ }
{...}
Swagger
Codegen
API
Doc
(HTML)
Ada
REST
Client
Ada
REST
Server
Java
REST
Client
Java
REST
Server
...
Python
REST
Client
Python
Flask
Server
...
25+
Programming Languages
https://github.com/stcarrez/swagger-ada 20
Ada REST Server
Generated code
Your server code and application
Swagger runtime
Brings REST server support with
security and OAuth2 support on
server side
Ada Security
Swagger Ada
Ada Utility Library
Server Skeleton & Model
Server Application
Ada Servlet
XML/Ada AWS
https://github.com/stcarrez/ada-awa 21
Conclusion
● Ada for Web Development
– Use UML for database modeling
– Use a security framework to authenticate&authorize
– Use ASF to benefit from Java server technologies
– Use OpenAPI to leverage REST API support
● AWA Programmer’s Guide
– https://ada-awa.readthedocs.io/en/latest/

Contenu connexe

Tendances

Data power v7 update - Ravi Katikala
Data power v7 update - Ravi KatikalaData power v7 update - Ravi Katikala
Data power v7 update - Ravi Katikala
floridawusergroup
 

Tendances (20)

Snowflake Architecture.pptx
Snowflake Architecture.pptxSnowflake Architecture.pptx
Snowflake Architecture.pptx
 
HPE SimpliVity
HPE SimpliVityHPE SimpliVity
HPE SimpliVity
 
Intro to Azure Data Factory v1
Intro to Azure Data Factory v1Intro to Azure Data Factory v1
Intro to Azure Data Factory v1
 
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta LakeIntroducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
 
Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
Oracle 12c Information Lifecycle Management
Oracle 12c Information Lifecycle ManagementOracle 12c Information Lifecycle Management
Oracle 12c Information Lifecycle Management
 
Microsoft Azure Data Factory Hands-On Lab Overview Slides
Microsoft Azure Data Factory Hands-On Lab Overview SlidesMicrosoft Azure Data Factory Hands-On Lab Overview Slides
Microsoft Azure Data Factory Hands-On Lab Overview Slides
 
Oracle AFD
Oracle AFDOracle AFD
Oracle AFD
 
Sql server 2019 new features
Sql server 2019 new featuresSql server 2019 new features
Sql server 2019 new features
 
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
 
Building Modern Data Platform with Microsoft Azure
Building Modern Data Platform with Microsoft AzureBuilding Modern Data Platform with Microsoft Azure
Building Modern Data Platform with Microsoft Azure
 
Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)
 
Democratizing Data
Democratizing DataDemocratizing Data
Democratizing Data
 
Unified Big Data Processing with Apache Spark (QCON 2014)
Unified Big Data Processing with Apache Spark (QCON 2014)Unified Big Data Processing with Apache Spark (QCON 2014)
Unified Big Data Processing with Apache Spark (QCON 2014)
 
Azure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CourseAzure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full Course
 
SAP BI/BW
SAP BI/BWSAP BI/BW
SAP BI/BW
 
Introduction of Oracle
Introduction of Oracle Introduction of Oracle
Introduction of Oracle
 
Sap short cuts
Sap short cutsSap short cuts
Sap short cuts
 
Understanding Oracle RAC 11g Release 2 Internals
Understanding Oracle RAC 11g Release 2 InternalsUnderstanding Oracle RAC 11g Release 2 Internals
Understanding Oracle RAC 11g Release 2 Internals
 
Data power v7 update - Ravi Katikala
Data power v7 update - Ravi KatikalaData power v7 update - Ravi Katikala
Data power v7 update - Ravi Katikala
 

Similaire à Ada for Web Development

CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
Spiffy
 
Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environment
starchaser
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azure
CEDRIC DERUE
 

Similaire à Ada for Web Development (20)

Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
 
Building microservices sample application
Building microservices sample applicationBuilding microservices sample application
Building microservices sample application
 
Intro to Azure Static Web Apps
Intro to Azure Static Web AppsIntro to Azure Static Web Apps
Intro to Azure Static Web Apps
 
Real-Time Web Applications with ASP.NET WebAPI and SignalR
Real-Time Web Applications with ASP.NET WebAPI and SignalRReal-Time Web Applications with ASP.NET WebAPI and SignalR
Real-Time Web Applications with ASP.NET WebAPI and SignalR
 
Resthub
ResthubResthub
Resthub
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
 
Mvc3 crash
Mvc3 crashMvc3 crash
Mvc3 crash
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
Cloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersCloud State of the Union for Java Developers
Cloud State of the Union for Java Developers
 
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
 
Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environment
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
ASPNET Roadmap
ASPNET RoadmapASPNET Roadmap
ASPNET Roadmap
 
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azure
 

Plus de Stephane Carrez

AKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensiblesAKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensibles
Stephane Carrez
 

Plus de Stephane Carrez (8)

Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
 
Porion a new Build Manager
Porion a new Build ManagerPorion a new Build Manager
Porion a new Build Manager
 
Protect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada KeystoreProtect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada Keystore
 
AKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensiblesAKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensibles
 
Secure Web Applications with AWA
Secure Web Applications with AWASecure Web Applications with AWA
Secure Web Applications with AWA
 
Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)
 
Writing REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger AdaWriting REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger Ada
 
IP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar ProfileIP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar Profile
 

Dernier

₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
Diya Sharma
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
 

Dernier (20)

₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft DatingDubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 

Ada for Web Development

  • 1. Ada for Web Development Stéphane Carrez AdaCore Tech Days
  • 2. https://github.com/stcarrez/ada-awa 2 Web Application Architectures ● Legacy HTML web app ● Single page web app Client Browser API REST Server Back End DatabaseGET HTML+JS GET JSON Static HTML React JS Vue.js Client Browser Server Front End Server Back End Database GET HTML
  • 3. https://github.com/stcarrez/ada-awa 3 Introducing Ada Web Application ● Project started in 2011 with already 6 releases ● Based on experience building SaaS application (J2EE, Java Server Faces, Hibernate, OAuth2)
  • 4. https://github.com/stcarrez/ada-awa 4 AWA Architecture Ada Web Application Ada Database Objects OpenAPI Ada Ada Server Faces Ada Servlet Ada WikiAda EL Ada Security Ada UtilAda Web Server XML/Ada MySQL PostgreSQL SQLite GNU/Linux WindowsFreeBSDNetBSD Your Web Application Dynamo
  • 5. https://github.com/stcarrez/ada-awa 5 AWA Features Comments Counters Votes Tags Changelogs Users Jobs EventsMails Wikis Storages ImagesBlogs Questions General purpose components System components Functional components Permissions Settings Flotcharts Trumbowyg SetupWorkspaces
  • 6. https://github.com/stcarrez/ada-awa 6 AWA Request Flow Servlet Filter Client Server Faces Servlet AWS Module Database Ada Bean GET Do_Filter Do_Get Set_Value Get_Value Load
  • 7. https://github.com/stcarrez/ada-awa 7 Challenge: Database Access Servlet Filter Client Server Faces Servlet AWS Module Database Ada Bean GET Do_Filter Do_Get Set_Value Get_Value Load Access database content while using Ada strong typing
  • 8. https://github.com/stcarrez/ada-ado 8 Database Modeling XML Model Dynamo Generator Model Doc (HTML) SQL Tables Ada Model Packages UML Model Ada Database Objects Library Generated Application Model Packages Your Application Code Ada Utility Library Postgresql, MySQL or SQLite Generate Develop YAML Model Design
  • 9. https://github.com/stcarrez/ada-ado 9 Generated Ada Model ● Public object reference type with accessors ● Private implementation type holds the values ● Load, Save, Delete, Find operations package AWA.Users.Model is   type Status_Type is (INACTIVE, REGISTERING, ACTIVE);   type Email_Ref is new ADO.Objects.Object_Ref with null record;   type User_Ref is new ADO.Objects.Object_Ref with null record;   procedure Set_Name (Object : in out User_Ref; Value : in String);   function Get_Name (Object : in User_Ref) return String;   overriding procedure Save (Object : in out User_Ref; ...); ... private   type Email_Impl is new ADO.Objects.Object_Record ...;   type User_Impl is new ADO.Objects.Object_Record ...; end AWA.Users.Model;
  • 10. https://github.com/stcarrez/ada-ado 10 Using the Ada Model ● Declare T_Ref instances ● Use Get_X and Set_X to access attributes ● Use Load, Find to retrieve and Save, Delete to modify   User  : User_Ref;   Email : Email_Ref;   User.Set_Name (“Ada Lovelace”);   User.Set_Status (REGISTERING);   User.Save (Session);   ...   Email.Set_Emailaddress (“ada@protonmail.com”);   Email.Set_User (User);   Email.Save (Session);   User.Set_Email (Email);   User.Set_Status (ACTIVE);   User.Save (Session); INSERT INTO user (id,object_version,name, email,date,status) VALUES(?, ?, ?, ?, ?, ?) INSERT INTO email (id,version,name, emailAddress, user) VALUES(?, ?, ?, ?) UPDATE user SET status = ?, email = ? WHERE id = ? AND object_version = ?
  • 11. https://github.com/stcarrez/ada-awa 11 Challenge: Access Control Servlet Filter Client Server Faces Servlet AWS Module Database Ada Bean GET Do_Filter Do_Get Set_Value Get_Value Load Authorize access Data access permission checkPermission check in views: Hide forbidden operations
  • 12. https://github.com/stcarrez/ada-security 12 Ada Security: Authenticate & Authorize Security Context OpenID Connect Authenticate Postgresql, MySQL or SQLite [2.3] Check permission [1.1] Authenticate OAuth 2 [2.2] Ask authorization Security Policy Manager Postgresql, MySQL or SQLite Users ACL, Permissions [2.4] Access granted [2.4] Access denied [1.2] create security context Policy 1 Policy N
  • 13. https://github.com/stcarrez/ada-awa 13 Challenge: Web Presentation Servlet Filter Client Server Faces Servlet AWS Module Database Ada Bean GET Do_Filter Do_Get Set_Value Get_Value Load Format user’s data in HTML page Validate request parameters
  • 14. https://github.com/stcarrez/ada-asf 14 Ada Server Faces (Java JSR 344) ● MVC web framework ● Render HTML, XML, JSON, Text,…, Ada ● Validate inputs ● Uses XML to describe views
  • 15. https://github.com/stcarrez/ada-asf 15 Ada Server Faces ● Facelets: XHTML files with templating ● Component based interface <f:metadata>   <f:viewParam id=’page’ value=’#{wikiView.name}’/>   <f:viewAction action='#{wikiView.load}'/> </f:metadata> <div>   <awa:wiki value=”#{wikiView.content}”/> </div> <div class="wiki­page­footer">   <h:outputFormat styleClass="wiki­page­date"                   value="#{wikiMsg.wiki_page_info_date}">     <f:param value="#{wikiView.date}"/>     <f:converter converterId="smartDateConverter"/>   </h:outputFormat> </div> Custom UI component: render wiki text Operation called before rendering Standard UI component with custom format
  • 16. https://github.com/stcarrez/ada-el 16 Ada EL (Java JSR 245) ● The presentation layer need values from Ada objects ● EL is a simple but powerful expression language ● Java implements EL using introspection ● Implemented in Ada using limited interface #{wikiView.title} type Wiki_View_Bean is ...   Title : Unbounded_String;   ... end record; EL expression Ada
  • 17. https://github.com/stcarrez/ada-awa 17 Challenge: REST API ● Single page web app Client Browser API REST Server Back End DatabaseGET HTML+JS GET JSON Static HTML React JS Vue.js Expose well defined REST API for Javascript frameworks
  • 18. https://github.com/stcarrez/swagger-ada 18 OpenAPI Specification ● Started in 2010 to describe REST APIs ● OpenAPI Initiative created in Nov 5, 2015 (Google, Microsoft, IBM, Paypal, ...) ● OpenAPI 3.0 released July 26, 2017 ● https://github.com/OAI/OpenAPI-Specification
  • 19. https://github.com/stcarrez/swagger-ada 19 Swagger/OpenAPI Tools OpenAPI Document YAML JSON{ } {...} Swagger Codegen API Doc (HTML) Ada REST Client Ada REST Server Java REST Client Java REST Server ... Python REST Client Python Flask Server ... 25+ Programming Languages
  • 20. https://github.com/stcarrez/swagger-ada 20 Ada REST Server Generated code Your server code and application Swagger runtime Brings REST server support with security and OAuth2 support on server side Ada Security Swagger Ada Ada Utility Library Server Skeleton & Model Server Application Ada Servlet XML/Ada AWS
  • 21. https://github.com/stcarrez/ada-awa 21 Conclusion ● Ada for Web Development – Use UML for database modeling – Use a security framework to authenticate&authorize – Use ASF to benefit from Java server technologies – Use OpenAPI to leverage REST API support ● AWA Programmer’s Guide – https://ada-awa.readthedocs.io/en/latest/