SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
seminar
service-oriented
webapp construction
using a metaframework
Juan Manuel Dodero
juanma.dodero@uca.es
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
agenda issue
webapp construction
context
web of data
service-oriented
web frameworks
techniques
ReST services
JSON data
tooling
spring ROO framework
practice
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
issue
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
modern webapp construction
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
goal
[easily] implement
service-oriented web apps
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
context
Licensed under Creative Commons
Attribution-Share Alike 3.0
service-oriented
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
webofdata
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
web app architecture
© 2013-2014 Juan M. Dodero
architectural abstraction MVC pattern
data access tier abstraction ORM pattern
Licensed under Creative Commons
Attribution-Share Alike 3.0
constructing with web frameworks
© 2013-2014 Juan M. Dodero
spring
framework
client code
abstraction e.g. MVC pattern
inversion of control e.g. Spring DI & AOP
Licensed under Creative Commons
Attribution-Share Alike 3.0
constructing with frameworks
© 2013-2014 Juan M. Dodero
framework
control flow
client code
class MyObject extends Object
{
myMethod() {...}
}
o.myMethod();
abstraction design patterns
inversion of control dependency injection
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
framework trends
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
framework trends
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
techniques
Licensed under Creative Commons
Attribution-Share Alike 3.0
example
Requirements
PizzaShop must build and deploy a set of web services to
enable clients:
!  get a list of pizzas
!  get info on a specific pizza
!  submit a pizza purchase order
!  etc
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
Request
[XML doc]
Response
[XML doc]
webserver
SOAP
envelope
HTTP
POST aURL
HTTP
Response
getPizzaList()
Request
[XML doc]
Response
[XML doc]
HTTP
POST aURL
HTTP
Response
getPizza(id)SOAP
server
Request
[XML doc]
HTTP
POST aURL
submit(PizzaOrder)
Response
[XML doc]
HTTP
Response
SOAP implementation
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
webserver
HTTP GET request /pizzas
HTTP response
Response
(HTML/XML/JSON doc)
HTTP GET request
HTTP response
HTTP POST
/pizzaorder/id
HTTP responseURL to submitted Order
Request
(HTML/XML/JSON)
Pizza
List
Pizza
Pizza
Order
ReST implementation
© 2013-2014 Juan M. Dodero
/pizza/id
Response
(HTML/XML/JSON doc)
Licensed under Creative Commons
Attribution-Share Alike 3.0
ReST design
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
JSON data serialization
© 2013-2014 Juan M. Dodero
$ curl -s -H "Accept: application/json" http://localhost:8080/pizzashop/pizzas | jq .
[
{
"version": 1,
"toppings": [
{
"version": 1,
"name": "Mozzarella",
"id": 9
},
{
"version": 1,
"name": "Anchovy fillets",
"id": 10
}
],
"price": 7.5,
"name": "Napolitana",
"id": 8,
"base": {
"version": 1,
"name": "Thin Crust",
"id": 1
}
}
]
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
tooling
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
“fundamentally improve Java developer productivity
without compromising engineering integrity or flexibility"!
Licensed under Creative Commons
Attribution-Share Alike 3.0
spring ROO features
! 100% java: based on other solid, well-known frameworks
(spring, hibernate, apache tiles, aspectj, flexJSON, dojoToolkit, etc.)
! convention over configuration
! meta-framework (generates source code)
! generated/manual code keep in sync
! works in build-time (not run-time)
! command console
! extensible by add-ons
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
roo architecture
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
ReST URI pattern
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
demo roo console
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
demo web app
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
demo domain model
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
demo roo script
// Create a new project
project --topLevelPackage com.springsource.pizzashop
// Setup JPA persistence using EclipseLink and H2
jpa setup --provider ECLIPSELINK --database H2_IN_MEMORY
// Create domain entities
entity jpa --class ~.domain.Base --activeRecord false --testAutomatically
field string --fieldName name --sizeMin 2 –notNull
entity jpa --class ~.domain.Topping --activeRecord false --
testAutomatically
field string --fieldName name --sizeMin 2 –notNull
entity jpa --class ~.domain.Pizza --activeRecord false --testAutomatically
field string --fieldName name --notNull --sizeMin 2
field number --fieldName price --type java.math.BigDecimal
field set --fieldName toppings --type ~.domain.Topping
field reference --fieldName base --type ~.domain.Base
entity jpa --class ~.domain.PizzaOrder --testAutomatically --activeRecord
false --identifierType ~.domain.PizzaOrderPk
field string --fieldName name --notNull --sizeMin 2
field string --fieldName address --sizeMax 30
field number --fieldName total --type java.math.BigDecimal
field date --fieldName deliveryDate --type java.util.Date
field set --fieldName pizzas --type ~.domain.Pizza
field string --fieldName shopCountry --class ~.domain.PizzaOrderPk
field string --fieldName shopCity
field string --fieldName shopName
// Define a repository layer for persistence
repository jpa --interface ~.repository.ToppingRepository --entity
~.domain.Topping
repository jpa --interface ~.repository.BaseRepository --entity
~.domain.Base
repository jpa --interface ~.repository.PizzaRepository --entity
~.domain.Pizza
repository jpa --interface ~.repository.PizzaOrderRepository --entity
~.domain.PizzaOrder
// Define a service/façade layer
service type --interface ~.service.ToppingService --entity
~.domain.Topping
service type --interface ~.service.BaseService --entity ~.domain.Base
service type --interface ~.service.PizzaService --entity ~.domain.Pizza
service type --interface ~.service.PizzaOrderService --entity
~.domain.PizzaOrder
// Offer JSON remoting for all domain types through Spring MVC
json all --deepSerialize
web mvc json setup
web mvc json all --package ~.web
web mvc setup
web mvc all --package ~.web
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
demo json data
© 2013-2014 Juan M. Dodero
$ curl -s -H "Accept: application/json" http://localhost:8080/pizzashop/pizzas | jq .
[
{
"version": 1,
"toppings": [
{
"version": 1,
"name": "Mozzarella",
"id": 9
},
{
"version": 1,
"name": "Anchovy fillets",
"id": 10
}
],
"price": 7.5,
"name": "Napolitana",
"id": 8,
"base": {
"version": 1,
"name": "Thin Crust",
"id": 1
}
}
]
Licensed under Creative Commons
Attribution-Share Alike 3.0
~.domain.Pizza
© 2013-2014 Juan M. Dodero
@RooJavaBean	
  
@RooToString	
  
@RooJpaEntity	
  
@RooJson(deepSerialize	
  =	
  true)	
  
public	
  class	
  Pizza	
  {	
  
	
  	
  	
  	
  @NotNull	
  
	
  	
  	
  	
  @Size(min	
  =	
  2)	
  
	
  	
  	
  	
  private	
  String	
  name;	
  
	
  	
  	
  	
  private	
  BigDecimal	
  price;	
  
	
  	
  	
  	
  @ManyToMany(cascade	
  =	
  CascadeType.ALL)	
  
	
  	
  	
  	
  private	
  Set<Topping>	
  toppings	
  =	
  new	
  HashSet<Topping>();	
  
	
  	
  	
  	
  @ManyToOne	
  
	
  	
  	
  	
  private	
  Base	
  base;	
  
}	
  
Licensed under Creative Commons
Attribution-Share Alike 3.0
Pizza_Roo_JavaBean.aj
© 2013-2014 Juan M. Dodero
privileged	
  aspect	
  Pizza_Roo_JavaBean	
  {	
  
	
  	
  	
  	
  public	
  String	
  Pizza.getName()	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  return	
  this.name;	
  
	
  	
  	
  	
  }	
  
	
  	
  	
  	
  public	
  void	
  Pizza.setName(String	
  name)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  this.name	
  =	
  name;	
  
	
  	
  	
  	
  }	
  
	
  	
  	
  	
  ...	
  
	
  	
  	
  	
  public	
  Set<Topping>	
  Pizza.getToppings()	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  return	
  this.toppings;	
  
	
  	
  	
  	
  }	
  
	
  	
  	
  	
  public	
  void	
  Pizza.setToppings(Set<Topping>	
  toppings)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  this.toppings	
  =	
  toppings;	
  
	
  	
  	
  	
  }	
  
	
  	
  	
  	
  public	
  Base	
  Pizza.getBase()	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  return	
  this.base;	
  
	
  	
  	
  	
  }	
  
	
  	
  	
  	
  public	
  void	
  Pizza.setBase(Base	
  base)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  this.base	
  =	
  base;	
  
	
  	
  	
  	
  }	
  
}	
  
Licensed under Creative Commons
Attribution-Share Alike 3.0
Pizza_Roo_Json.aj
© 2013-2014 Juan M. Dodero
privileged	
  aspect	
  Pizza_Roo_Json	
  {	
  
	
  	
  ...	
  
	
  	
  public	
  String	
  Pizza.toJson(String[]	
  fields)	
  {	
  
	
  	
  	
  	
  	
  return	
  new	
  JSONSerializer()	
  
	
  	
  	
  	
  	
  	
  .include(fields).exclude("*.class").deepSerialize(this);	
  
	
  	
  }	
  
	
  	
  public	
  static	
  Pizza	
  Pizza.fromJsonToPizza(String	
  json)	
  {	
  
	
  	
  	
  	
  	
  	
  return	
  new	
  JSONDeserializer<Pizza>()	
  
	
  	
  	
  	
  	
  	
  	
  .use(null,	
  Pizza.class).deserialize(json);	
  
	
  	
  }	
  
	
  	
  public	
  static	
  String	
  Pizza.toJsonArray(Collection<Pizza>	
  collection)	
  {	
  
	
  	
  	
  	
  	
  	
  return	
  new	
  JSONSerializer()	
  
	
  	
  	
  	
  	
  	
  	
  .exclude("*.class").deepSerialize(collection);	
  
	
  	
  }	
  
	
  	
  ...	
  
	
  	
  public	
  static	
  Collection<Pizza>	
  Pizza.fromJsonArrayToPizzas(String	
  json)	
  {	
  
	
  	
  	
  	
  return	
  new	
  JSONDeserializer<List<Pizza>>()	
  
	
  	
  	
  	
  	
  .use("values",	
  Pizza.class).deserialize(json);	
  
	
  	
  }	
  
}	
  
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
http://dodero.github.io/sosc-wmf/
practice
Licensed under Creative Commons
Attribution-Share Alike 3.0
references
© 2013-2014 Juan M. Dodero
Licensed under Creative Commons
Attribution-Share Alike 3.0
© 2013-2014 Juan M. Dodero
Attribution-Share Alike 3.0

Mais conteúdo relacionado

Semelhante a Service-oriented webapp construction using a web metaframework

Advanced #2 networking
Advanced #2   networkingAdvanced #2   networking
Advanced #2 networkingVitali Pekelis
 
Server Side Swift with Swag
Server Side Swift with SwagServer Side Swift with Swag
Server Side Swift with SwagJens Ravens
 
The unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingThe unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingMatteo Bonifazi
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Seb Rose
 
The unconventional devices for the video streaming in Android
The unconventional devices for the video streaming in AndroidThe unconventional devices for the video streaming in Android
The unconventional devices for the video streaming in AndroidAlessandro Martellucci
 
HTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The DeadHTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The Deadnoamt
 
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTechNETFest
 
7 Tips on Getting Your Theme Approved the First Time
7 Tips on Getting Your Theme Approved the First Time7 Tips on Getting Your Theme Approved the First Time
7 Tips on Getting Your Theme Approved the First TimeDmitry Mayorov
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3Luciano Mammino
 
Rest-in-contract basic concepts & flows
Rest-in-contract basic concepts & flowsRest-in-contract basic concepts & flows
Rest-in-contract basic concepts & flowsEric Yu
 
The Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIThe Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIEyal Vardi
 
Extending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss ForgeExtending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss ForgeAntoine Sabot-Durand
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Startedguest1af57e
 
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css New Pe.docx
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css   New Pe.docxgbar.jpgglogo.jpgmaa.jpgmaah5txt.css   New Pe.docx
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css New Pe.docxbudbarber38650
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumJeroen van Dijk
 
From 🐛 to 🦋: Data Pipelines Evolution from Batch to Streaming
From 🐛 to 🦋: Data Pipelines Evolution from Batch to StreamingFrom 🐛 to 🦋: Data Pipelines Evolution from Batch to Streaming
From 🐛 to 🦋: Data Pipelines Evolution from Batch to StreamingHostedbyConfluent
 

Semelhante a Service-oriented webapp construction using a web metaframework (20)

Advanced #2 networking
Advanced #2   networkingAdvanced #2   networking
Advanced #2 networking
 
Server Side Swift with Swag
Server Side Swift with SwagServer Side Swift with Swag
Server Side Swift with Swag
 
The unconventional devices for the Android video streaming
The unconventional devices for the Android video streamingThe unconventional devices for the Android video streaming
The unconventional devices for the Android video streaming
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
 
The unconventional devices for the video streaming in Android
The unconventional devices for the video streaming in AndroidThe unconventional devices for the video streaming in Android
The unconventional devices for the video streaming in Android
 
HTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The DeadHTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The Dead
 
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
 
7 Tips on Getting Your Theme Approved the First Time
7 Tips on Getting Your Theme Approved the First Time7 Tips on Getting Your Theme Approved the First Time
7 Tips on Getting Your Theme Approved the First Time
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3
 
LiveOps para games usando o Firebase
LiveOps para games usando o FirebaseLiveOps para games usando o Firebase
LiveOps para games usando o Firebase
 
Recyclerview in action
Recyclerview in action Recyclerview in action
Recyclerview in action
 
Rest-in-contract basic concepts & flows
Rest-in-contract basic concepts & flowsRest-in-contract basic concepts & flows
Rest-in-contract basic concepts & flows
 
The Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIThe Full Power of ASP.NET Web API
The Full Power of ASP.NET Web API
 
RPC Over DDS
RPC Over DDSRPC Over DDS
RPC Over DDS
 
Extending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss ForgeExtending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss Forge
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css New Pe.docx
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css   New Pe.docxgbar.jpgglogo.jpgmaa.jpgmaah5txt.css   New Pe.docx
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css New Pe.docx
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
 
From 🐛 to 🦋: Data Pipelines Evolution from Batch to Streaming
From 🐛 to 🦋: Data Pipelines Evolution from Batch to StreamingFrom 🐛 to 🦋: Data Pipelines Evolution from Batch to Streaming
From 🐛 to 🦋: Data Pipelines Evolution from Batch to Streaming
 

Último

Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
₹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
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
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.soniya singh
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
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 GIRLimonikaupta
 
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...sonatiwari757
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 

Último (20)

Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
 
₹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...
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
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.
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
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
 
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 

Service-oriented webapp construction using a web metaframework

  • 1. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero seminar service-oriented webapp construction using a metaframework Juan Manuel Dodero juanma.dodero@uca.es
  • 2. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero agenda issue webapp construction context web of data service-oriented web frameworks techniques ReST services JSON data tooling spring ROO framework practice
  • 3. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero issue
  • 4. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero modern webapp construction
  • 5. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero goal [easily] implement service-oriented web apps
  • 6. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero context
  • 7. Licensed under Creative Commons Attribution-Share Alike 3.0 service-oriented © 2013-2014 Juan M. Dodero
  • 8. Licensed under Creative Commons Attribution-Share Alike 3.0 webofdata © 2013-2014 Juan M. Dodero
  • 9. Licensed under Creative Commons Attribution-Share Alike 3.0 web app architecture © 2013-2014 Juan M. Dodero architectural abstraction MVC pattern data access tier abstraction ORM pattern
  • 10. Licensed under Creative Commons Attribution-Share Alike 3.0 constructing with web frameworks © 2013-2014 Juan M. Dodero spring framework client code abstraction e.g. MVC pattern inversion of control e.g. Spring DI & AOP
  • 11. Licensed under Creative Commons Attribution-Share Alike 3.0 constructing with frameworks © 2013-2014 Juan M. Dodero framework control flow client code class MyObject extends Object { myMethod() {...} } o.myMethod(); abstraction design patterns inversion of control dependency injection
  • 12. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero framework trends
  • 13. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero framework trends
  • 14. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero techniques
  • 15. Licensed under Creative Commons Attribution-Share Alike 3.0 example Requirements PizzaShop must build and deploy a set of web services to enable clients: !  get a list of pizzas !  get info on a specific pizza !  submit a pizza purchase order !  etc © 2013-2014 Juan M. Dodero
  • 16. Licensed under Creative Commons Attribution-Share Alike 3.0 Request [XML doc] Response [XML doc] webserver SOAP envelope HTTP POST aURL HTTP Response getPizzaList() Request [XML doc] Response [XML doc] HTTP POST aURL HTTP Response getPizza(id)SOAP server Request [XML doc] HTTP POST aURL submit(PizzaOrder) Response [XML doc] HTTP Response SOAP implementation © 2013-2014 Juan M. Dodero
  • 17. Licensed under Creative Commons Attribution-Share Alike 3.0 webserver HTTP GET request /pizzas HTTP response Response (HTML/XML/JSON doc) HTTP GET request HTTP response HTTP POST /pizzaorder/id HTTP responseURL to submitted Order Request (HTML/XML/JSON) Pizza List Pizza Pizza Order ReST implementation © 2013-2014 Juan M. Dodero /pizza/id Response (HTML/XML/JSON doc)
  • 18. Licensed under Creative Commons Attribution-Share Alike 3.0 ReST design © 2013-2014 Juan M. Dodero
  • 19. Licensed under Creative Commons Attribution-Share Alike 3.0 JSON data serialization © 2013-2014 Juan M. Dodero $ curl -s -H "Accept: application/json" http://localhost:8080/pizzashop/pizzas | jq . [ { "version": 1, "toppings": [ { "version": 1, "name": "Mozzarella", "id": 9 }, { "version": 1, "name": "Anchovy fillets", "id": 10 } ], "price": 7.5, "name": "Napolitana", "id": 8, "base": { "version": 1, "name": "Thin Crust", "id": 1 } } ]
  • 20. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero tooling
  • 21. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero “fundamentally improve Java developer productivity without compromising engineering integrity or flexibility"!
  • 22. Licensed under Creative Commons Attribution-Share Alike 3.0 spring ROO features ! 100% java: based on other solid, well-known frameworks (spring, hibernate, apache tiles, aspectj, flexJSON, dojoToolkit, etc.) ! convention over configuration ! meta-framework (generates source code) ! generated/manual code keep in sync ! works in build-time (not run-time) ! command console ! extensible by add-ons © 2013-2014 Juan M. Dodero
  • 23. Licensed under Creative Commons Attribution-Share Alike 3.0 roo architecture © 2013-2014 Juan M. Dodero
  • 24. Licensed under Creative Commons Attribution-Share Alike 3.0 ReST URI pattern © 2013-2014 Juan M. Dodero
  • 25. Licensed under Creative Commons Attribution-Share Alike 3.0 demo roo console © 2013-2014 Juan M. Dodero
  • 26. Licensed under Creative Commons Attribution-Share Alike 3.0 demo web app © 2013-2014 Juan M. Dodero
  • 27. Licensed under Creative Commons Attribution-Share Alike 3.0 demo domain model © 2013-2014 Juan M. Dodero
  • 28. Licensed under Creative Commons Attribution-Share Alike 3.0 demo roo script // Create a new project project --topLevelPackage com.springsource.pizzashop // Setup JPA persistence using EclipseLink and H2 jpa setup --provider ECLIPSELINK --database H2_IN_MEMORY // Create domain entities entity jpa --class ~.domain.Base --activeRecord false --testAutomatically field string --fieldName name --sizeMin 2 –notNull entity jpa --class ~.domain.Topping --activeRecord false -- testAutomatically field string --fieldName name --sizeMin 2 –notNull entity jpa --class ~.domain.Pizza --activeRecord false --testAutomatically field string --fieldName name --notNull --sizeMin 2 field number --fieldName price --type java.math.BigDecimal field set --fieldName toppings --type ~.domain.Topping field reference --fieldName base --type ~.domain.Base entity jpa --class ~.domain.PizzaOrder --testAutomatically --activeRecord false --identifierType ~.domain.PizzaOrderPk field string --fieldName name --notNull --sizeMin 2 field string --fieldName address --sizeMax 30 field number --fieldName total --type java.math.BigDecimal field date --fieldName deliveryDate --type java.util.Date field set --fieldName pizzas --type ~.domain.Pizza field string --fieldName shopCountry --class ~.domain.PizzaOrderPk field string --fieldName shopCity field string --fieldName shopName // Define a repository layer for persistence repository jpa --interface ~.repository.ToppingRepository --entity ~.domain.Topping repository jpa --interface ~.repository.BaseRepository --entity ~.domain.Base repository jpa --interface ~.repository.PizzaRepository --entity ~.domain.Pizza repository jpa --interface ~.repository.PizzaOrderRepository --entity ~.domain.PizzaOrder // Define a service/façade layer service type --interface ~.service.ToppingService --entity ~.domain.Topping service type --interface ~.service.BaseService --entity ~.domain.Base service type --interface ~.service.PizzaService --entity ~.domain.Pizza service type --interface ~.service.PizzaOrderService --entity ~.domain.PizzaOrder // Offer JSON remoting for all domain types through Spring MVC json all --deepSerialize web mvc json setup web mvc json all --package ~.web web mvc setup web mvc all --package ~.web © 2013-2014 Juan M. Dodero
  • 29. Licensed under Creative Commons Attribution-Share Alike 3.0 demo json data © 2013-2014 Juan M. Dodero $ curl -s -H "Accept: application/json" http://localhost:8080/pizzashop/pizzas | jq . [ { "version": 1, "toppings": [ { "version": 1, "name": "Mozzarella", "id": 9 }, { "version": 1, "name": "Anchovy fillets", "id": 10 } ], "price": 7.5, "name": "Napolitana", "id": 8, "base": { "version": 1, "name": "Thin Crust", "id": 1 } } ]
  • 30. Licensed under Creative Commons Attribution-Share Alike 3.0 ~.domain.Pizza © 2013-2014 Juan M. Dodero @RooJavaBean   @RooToString   @RooJpaEntity   @RooJson(deepSerialize  =  true)   public  class  Pizza  {          @NotNull          @Size(min  =  2)          private  String  name;          private  BigDecimal  price;          @ManyToMany(cascade  =  CascadeType.ALL)          private  Set<Topping>  toppings  =  new  HashSet<Topping>();          @ManyToOne          private  Base  base;   }  
  • 31. Licensed under Creative Commons Attribution-Share Alike 3.0 Pizza_Roo_JavaBean.aj © 2013-2014 Juan M. Dodero privileged  aspect  Pizza_Roo_JavaBean  {          public  String  Pizza.getName()  {                  return  this.name;          }          public  void  Pizza.setName(String  name)  {                  this.name  =  name;          }          ...          public  Set<Topping>  Pizza.getToppings()  {                  return  this.toppings;          }          public  void  Pizza.setToppings(Set<Topping>  toppings)  {                  this.toppings  =  toppings;          }          public  Base  Pizza.getBase()  {                  return  this.base;          }          public  void  Pizza.setBase(Base  base)  {                  this.base  =  base;          }   }  
  • 32. Licensed under Creative Commons Attribution-Share Alike 3.0 Pizza_Roo_Json.aj © 2013-2014 Juan M. Dodero privileged  aspect  Pizza_Roo_Json  {      ...      public  String  Pizza.toJson(String[]  fields)  {            return  new  JSONSerializer()              .include(fields).exclude("*.class").deepSerialize(this);      }      public  static  Pizza  Pizza.fromJsonToPizza(String  json)  {              return  new  JSONDeserializer<Pizza>()                .use(null,  Pizza.class).deserialize(json);      }      public  static  String  Pizza.toJsonArray(Collection<Pizza>  collection)  {              return  new  JSONSerializer()                .exclude("*.class").deepSerialize(collection);      }      ...      public  static  Collection<Pizza>  Pizza.fromJsonArrayToPizzas(String  json)  {          return  new  JSONDeserializer<List<Pizza>>()            .use("values",  Pizza.class).deserialize(json);      }   }  
  • 33. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero http://dodero.github.io/sosc-wmf/ practice
  • 34. Licensed under Creative Commons Attribution-Share Alike 3.0 references © 2013-2014 Juan M. Dodero
  • 35. Licensed under Creative Commons Attribution-Share Alike 3.0 © 2013-2014 Juan M. Dodero Attribution-Share Alike 3.0