SlideShare a Scribd company logo
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/

More Related Content

Similar to Ada for Web Development

Mvc3 crash
Mvc3 crashMvc3 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
Shahed Chowdhuri
 
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
Burr Sutter
 
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
Luis Du Solier
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Peter Gfader
 
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)
Hatem Hamad
 
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
Peter Gfader
 
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
 
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
Shahed Chowdhuri
 
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
Matt Raible
 
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
IMC Institute
 
ASPNET Roadmap
ASPNET RoadmapASPNET Roadmap
ASPNET Roadmap
ukdpe
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azure
CEDRIC DERUE
 
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...
MUG-Lyon Microsoft User Group
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Software Park Thailand
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
Android networking-2
Android networking-2Android networking-2
Android networking-2
Aravindharamanan S
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
SachinSingh217687
 
20180605 sso with apex and adfs the weblogic way
20180605 sso with apex and adfs the weblogic way20180605 sso with apex and adfs the weblogic way
20180605 sso with apex and adfs the weblogic way
makker_nl
 
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan WrightSummit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Andrew Ly
 

Similar to Ada for Web Development (20)

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
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azure
 
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...
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
Android networking-2
Android networking-2Android networking-2
Android networking-2
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
20180605 sso with apex and adfs the weblogic way
20180605 sso with apex and adfs the weblogic way20180605 sso with apex and adfs the weblogic way
20180605 sso with apex and adfs the weblogic way
 
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan WrightSummit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
 

More from Stephane Carrez

Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
Stephane Carrez
 
Porion a new Build Manager
Porion a new Build ManagerPorion a new Build Manager
Porion a new Build Manager
Stephane Carrez
 
Protect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada KeystoreProtect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada Keystore
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
 
Secure Web Applications with AWA
Secure Web Applications with AWASecure Web Applications with AWA
Secure Web Applications with AWA
Stephane Carrez
 
Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)
Stephane Carrez
 
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
Stephane Carrez
 
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
Stephane Carrez
 

More from 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
 

Recently uploaded

Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
saathvikreddy2003
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
AanSulistiyo
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 

Recently uploaded (20)

Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 

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/