SlideShare una empresa de Scribd logo
1 de 49
How to integrate
                                                your applications
                                                  with today‘s
                                               technology trends



             RESTful Web Services
                in VA Smalltalk
                              Joachim Tuchel

                           www.objektfabrik.de

© 2009 by Joachim Tuchel
Agenda
• About me and objektfabrik
• „Classic“ Web Services
• RESTful Web Services: What‘s different?
• RESTful Web Services with VA Smalltalk
• DEMO: REST Clients & Server
• Questions
About me
• Founder and director of objektfabrik
• Business Informatics (Banking)
• Smalltalk since 1996
  (VA Smalltalk,VisualWorks and Squeak)
• Java since 2004
• jtuchel@objektfabrik.de
About objektfabrik
• Founded 1999 in Ludwigsburg, Germany
• Training, Consulting, Professional Services
• Application and System architecture
• Software Development in Smalltalk, Java,
  Ruby and Objective-C
• Instantiations Business Partner since 2006
Training offerings
• Object Technology Basics
• Smalltalk Basics
• VA Smalltalk Application Development
• Advanced VA Smalltalk workshops
  (Packaging, Config Management, SUnit...)
• New in 2009: Seaside
Web Services
and VA Smalltalk
Web Services
• Uses HTTP/S POST for transport
 • in theory uses any transport protocol
• XML Messages
 • SOAP-Envelopes
 • Namespaces
 • Many standards / schemas available
Web Services

• W3C Standard
• Huge set of domain/industry specific and
  vertical (cross industry) standards (WS-*)
• Large selection of tools and vendors
• „Enterprise integration technology“
Web Services and VA
      Smalltalk
• Supported by VA Smalltalk since V 5.5
• Based on Server Smalltalk
• Constantly improved in 6.x, 7.x and 8
• Expose a Smalltalk method as a service
• Consume a service in Smalltalk
What‘s wrong with
    Web Services
• Heavy weight standard
• One size fits all (by being large enough)
• Can be very complicated to deploy and
  debug
  • Very complex XML structures
• Way too heavy for simple jobs
RESTful Web Services
RESTful Web Services
• REST = Representational State Transfer
• What is it?
 • Not a standard
 • It‘s an architecture
• Simplicity and Reuse of existing Standards
  like the HTTP (=Protocol) are design goals
REST is everywhere

• Amazon Web Services
 • Simple Storage System (S3)
 • SimpleDB - SQL - like Database
• eBay Shopping APIs
• PayPal
REST is everywhere
• Google REST APIs
 • Search, Blogger, Maps, Analytics...
• Yahoo! REST APIs
 • Finance, YQL, Travel, Weather...
• Twitter, Technorati, all over „Web 2.0“
• Apache CouchDB
REST is everywhere
• REST is part of „The Web“ today
• REST is used for
 • Integration
 • Distribution
 • Scaling
 • Mashups
Basic Concepts
Basic Concepts
• RESTful Web Services are about Resources,
  not about Services (operations)
Basic Concepts
• RESTful Web Services are about Resources,
  not about Services (operations)
• Addressability: Every Resource has a uniform
  name = URI
Basic Concepts
• RESTful Web Services are about Resources,
  not about Services (operations)
• Addressability: Every Resource has a uniform
  name = URI
  http://myhost/users/joachim/todolists...
Basic Concepts
• RESTful Web Services are about Resources,
  not about Services (operations)
• Addressability: Every Resource has a uniform
  name = URI
  http://myhost/users/joachim/todolists...
• Statelessness: Server doesn‘t save any
  application state ➠ Scalability
Basic Concepts
• Operations defined in HTTP standard
 • Create: POST a new resource
 • Read: GET a resource
 • Update: PUT a resource
 • Delete: DELETE a resource
• References to objects are IDs or hyperlinks
What‘s a Resource?
•                            •
    Customer                     Database Transaction

•                            •
    Purchasing Order             Flight Booking

•                            •
    Line Item                    Message

•                            •
    Hotel Room                   Dataset (RDB/OODB)

•                            •
    Hotel Room Reservation       any entity we deal with in
                                 our systems
•   User Account
What‘s a Resource?
• Not necessarily a Business Object!
  • Not all aspects need to be transported
     between applications
   • Some aspects belong to a different
     Business Object (save bandwidth)
• References become IDs or Hyperlinks
Basic Concepts
Basic Concepts


Client
Basic Concepts


                      Resource
Client
                       Server
Basic Concepts
             GET /users/Joachim




               HTTP Request
                                  Resource
Client
                                   Server
Basic Concepts
                 GET /users/Joachim




                    HTTP Request
                                           Resource
Client
                                            Server
                 HTTP Response
           HTTP/1.1 200 OK
           Content-Type: application/xml
           <?xml version=...>
            <User firstname=“...
Basic Concepts
                 GET /users/Joachim




                    HTTP Request
                                                       Resource
Client
                                                        Server
                 HTTP Response
           HTTP/1.1 200 OK
           Content-Type: application/xml
           <?xml version=...>
            <User firstname=“...



                                            Contents can be
                                      XML, JSON, CSV, Binary Data
                                            ...any MIME-Type
HTTP and Response
   Codes: GET
• 200 OK
• 400 Bad Request
• 401 Unauthorized / 403 Forbidden
• 404 Not found
• 500 Internal Server Error
HTTP Methods and
  Codes: POST
• 201 Created
• 409 Conflict
• 415 Unsupported Media Type
• 500 Internal Server Error
• Many more ...
Useful Advanced
     HTTP - Features
• If-Modified-Since / Last-Modified / 304 Not
  Modified for caching
• Cache-Control (read-only objects or
  infrequently changing objects)
• Content-Type to determine marshalers
• Accept-Ranges / Content-Range for partial
  loading of long lists etc.
Benefits of bare HTTP?
• Reduced Complexity: HTTP is easy
• Advantage in Development & Maintenance
• Uniform interface (HTTP) to every
  resource
• More flexibility: serving/accepting
  Resources instead of exposing a set of
  operations (➠Mashups)
RESTful Web Services
  with VA Smalltalk
Ingredients for
RESTful Web Services
• HTTP communications (Possibly HTTPS)
• Transport format for resource data
 • XML, JSON, plain ascii
• Marshalling and unmarshalling on both ends
• Naming Service (URI ➠ Resource ➠ URI)
VAST provides all the
  Building Blocks
• Server Smalltalk
 • HTTP Client and Server
 • Highly configurable and extendable on
        many levels
    •   Scalable (Multithreading by default)
    •   Mature (~10 years) and in use
•   XML marshalling
Building a
          REST Client
• Extends SstHttpClient
• Adds xml marshalling (or other marshalling
  like)
• Wraps simple HTTP requests and handles
  response codes
• Optional: Session / cookie handling,
  caching ... (Maybe not „pure“ REST)
PRESTON client
• getResourceNamed: aURI
  queryParameters: aDictionary
• postResource: anObject
  toResourceNamed: aURI
• deleteResourceNamed: aURI
• getOptionsForResourceNamed: aURI
• handles session cookies (optional)
PRESTON client
• Mapping between Resource (e.g. XML) and
  Smalltalk objects

• Optional caching (URI → object)
• Proxies for hyperlinks
  (linked resource is only fetched if needed)
• Can act as database client to a RESTful web
  service
Building a
           REST Server
• Extends several components of SST HTTP
  Server
• Is very similar to a servlet container (it
  serves resources with a certain URI)
• Adds marshalling, naming and more
SST Building Blocks
                        SstServerApplicationContext

   SstBasicServer              containerKey
                          sessionManagerConfig.
                                attributes
 applicationContexts
  sessionManagers
                             initializeRequest:
                             handlesRequest:
       startUp                                          SstHttpSessionManager
      shutDown
processClientRequest:
basicProcessRequest:

                                                       createSessionForRequest:
                                                           processRequest:
                                                       createCookieForSession:
    SstHttpServer
                                                      cookieFromRequestHeader...




SstHttpServletEngine
PRESTON Server
                        SstServerApplicationContext

   SstBasicServer              containerKey
                          sessionManagerConfig.
                                attributes
 applicationContexts
  sessionManagers
                             initializeRequest:
                             handlesRequest:
       startUp                                          SstHttpSessionManager
      shutDown
processClientRequest:
basicProcessRequest:

                                                       createSessionForRequest:
                                                           processRequest:
                                                       createCookieForSession:
    SstHttpServer
                                                      cookieFromRequestHeader...




                                                        PrestonResourceManager
                        PrestonApplicationContext

                                                         supportedHttpMethods
                            resourceManagers
   PrestonServer
                                                             pathSegment
                             xmlMappingSpec
                                rootObject

                                                          handleGETRequest..
                                                          handlePostRequest...
Demos

• Yahoo! Traffic Client
• Yahoo! Traffic Client on a Seaside Server
• Todomatic Server & Client
GET MapsService/V1/trafficData
                                                  with request parameters
                                                                                  PRESTON Client
       Yahoo! Traffic REST API
     http://local.yahooapis.com/
                                                              HTTP
                                                                                  Application Logic
                                                             Response
                                                             with XML
Sample Request URI:
http://local.yahooapis.com/MapsService/V1/trafficData?
appid=YdnDemo&street=701+First+Ave&city=Sunnyvale&state=CA




                                                                                             VA Smalltalk Image
ith
                                                     eventually w
                                                                 ody
                                                     a message b
                                                                   ML
                                                     containing X
                                                        document




                                        GET users/joachim/todolists
                                        POST users/joachim/todolists
                                                                           HTTP Client
   OODB            Todomatic            PUT users/joachim
                                                                        * Web Browser
                 RESTful Server                                         * PRESTON Smalltalk client
                   VA Smalltalk Image                                   * Any other HTTP Client
TodoLists and
 TodoItems                                                     nse
                                                   HTTP Respo
                                                                 l
                                                    with optiona
                                                                ent
                                                   XML Docum




   User         TodoList                TodoItem
Summary
RESTful Web Services
• Anywhere on the web today and growing
• Far less complex than Web Services
• HTTP standard all the way down
• Can be used for Internet applications as
  well as for internal systems
 • Integration
 • Scaling
VA Smalltalk and
RESTful Web Services
• Most Web Services are CRUD operations
• Integration today mostly means combining
  HTTP with XML or other text formats
• VA ST provides all the building blocks
 • Some extensions needed
• Can be combined with Seaside easily
 • Mashup your own services
Questions?


                                                 chel
                                          im Tu g 1
                                    Joach erwe
                                       Flied rmany
                                          g, Ge ik.de
                                     sbur tfabr
                                dwig bjek
                           40 Lu el@o               ik.de
                                              tfabr
                        716 tuch
                                       objek
                             j
                                  ww.
                                 w
More info on my blog:
www.joachim-tuchel.de

Más contenido relacionado

Último

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Último (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

Destacado

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destacado (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Building RESTful Web Services with VA Smalltalk

  • 1. How to integrate your applications with today‘s technology trends RESTful Web Services in VA Smalltalk Joachim Tuchel www.objektfabrik.de © 2009 by Joachim Tuchel
  • 2. Agenda • About me and objektfabrik • „Classic“ Web Services • RESTful Web Services: What‘s different? • RESTful Web Services with VA Smalltalk • DEMO: REST Clients & Server • Questions
  • 3. About me • Founder and director of objektfabrik • Business Informatics (Banking) • Smalltalk since 1996 (VA Smalltalk,VisualWorks and Squeak) • Java since 2004 • jtuchel@objektfabrik.de
  • 4. About objektfabrik • Founded 1999 in Ludwigsburg, Germany • Training, Consulting, Professional Services • Application and System architecture • Software Development in Smalltalk, Java, Ruby and Objective-C • Instantiations Business Partner since 2006
  • 5. Training offerings • Object Technology Basics • Smalltalk Basics • VA Smalltalk Application Development • Advanced VA Smalltalk workshops (Packaging, Config Management, SUnit...) • New in 2009: Seaside
  • 7. Web Services • Uses HTTP/S POST for transport • in theory uses any transport protocol • XML Messages • SOAP-Envelopes • Namespaces • Many standards / schemas available
  • 8. Web Services • W3C Standard • Huge set of domain/industry specific and vertical (cross industry) standards (WS-*) • Large selection of tools and vendors • „Enterprise integration technology“
  • 9. Web Services and VA Smalltalk • Supported by VA Smalltalk since V 5.5 • Based on Server Smalltalk • Constantly improved in 6.x, 7.x and 8 • Expose a Smalltalk method as a service • Consume a service in Smalltalk
  • 10. What‘s wrong with Web Services • Heavy weight standard • One size fits all (by being large enough) • Can be very complicated to deploy and debug • Very complex XML structures • Way too heavy for simple jobs
  • 12. RESTful Web Services • REST = Representational State Transfer • What is it? • Not a standard • It‘s an architecture • Simplicity and Reuse of existing Standards like the HTTP (=Protocol) are design goals
  • 13. REST is everywhere • Amazon Web Services • Simple Storage System (S3) • SimpleDB - SQL - like Database • eBay Shopping APIs • PayPal
  • 14. REST is everywhere • Google REST APIs • Search, Blogger, Maps, Analytics... • Yahoo! REST APIs • Finance, YQL, Travel, Weather... • Twitter, Technorati, all over „Web 2.0“ • Apache CouchDB
  • 15. REST is everywhere • REST is part of „The Web“ today • REST is used for • Integration • Distribution • Scaling • Mashups
  • 17. Basic Concepts • RESTful Web Services are about Resources, not about Services (operations)
  • 18. Basic Concepts • RESTful Web Services are about Resources, not about Services (operations) • Addressability: Every Resource has a uniform name = URI
  • 19. Basic Concepts • RESTful Web Services are about Resources, not about Services (operations) • Addressability: Every Resource has a uniform name = URI http://myhost/users/joachim/todolists...
  • 20. Basic Concepts • RESTful Web Services are about Resources, not about Services (operations) • Addressability: Every Resource has a uniform name = URI http://myhost/users/joachim/todolists... • Statelessness: Server doesn‘t save any application state ➠ Scalability
  • 21. Basic Concepts • Operations defined in HTTP standard • Create: POST a new resource • Read: GET a resource • Update: PUT a resource • Delete: DELETE a resource • References to objects are IDs or hyperlinks
  • 22. What‘s a Resource? • • Customer Database Transaction • • Purchasing Order Flight Booking • • Line Item Message • • Hotel Room Dataset (RDB/OODB) • • Hotel Room Reservation any entity we deal with in our systems • User Account
  • 23. What‘s a Resource? • Not necessarily a Business Object! • Not all aspects need to be transported between applications • Some aspects belong to a different Business Object (save bandwidth) • References become IDs or Hyperlinks
  • 26. Basic Concepts Resource Client Server
  • 27. Basic Concepts GET /users/Joachim HTTP Request Resource Client Server
  • 28. Basic Concepts GET /users/Joachim HTTP Request Resource Client Server HTTP Response HTTP/1.1 200 OK Content-Type: application/xml <?xml version=...> <User firstname=“...
  • 29. Basic Concepts GET /users/Joachim HTTP Request Resource Client Server HTTP Response HTTP/1.1 200 OK Content-Type: application/xml <?xml version=...> <User firstname=“... Contents can be XML, JSON, CSV, Binary Data ...any MIME-Type
  • 30. HTTP and Response Codes: GET • 200 OK • 400 Bad Request • 401 Unauthorized / 403 Forbidden • 404 Not found • 500 Internal Server Error
  • 31. HTTP Methods and Codes: POST • 201 Created • 409 Conflict • 415 Unsupported Media Type • 500 Internal Server Error • Many more ...
  • 32. Useful Advanced HTTP - Features • If-Modified-Since / Last-Modified / 304 Not Modified for caching • Cache-Control (read-only objects or infrequently changing objects) • Content-Type to determine marshalers • Accept-Ranges / Content-Range for partial loading of long lists etc.
  • 33. Benefits of bare HTTP? • Reduced Complexity: HTTP is easy • Advantage in Development & Maintenance • Uniform interface (HTTP) to every resource • More flexibility: serving/accepting Resources instead of exposing a set of operations (➠Mashups)
  • 34. RESTful Web Services with VA Smalltalk
  • 35. Ingredients for RESTful Web Services • HTTP communications (Possibly HTTPS) • Transport format for resource data • XML, JSON, plain ascii • Marshalling and unmarshalling on both ends • Naming Service (URI ➠ Resource ➠ URI)
  • 36. VAST provides all the Building Blocks • Server Smalltalk • HTTP Client and Server • Highly configurable and extendable on many levels • Scalable (Multithreading by default) • Mature (~10 years) and in use • XML marshalling
  • 37. Building a REST Client • Extends SstHttpClient • Adds xml marshalling (or other marshalling like) • Wraps simple HTTP requests and handles response codes • Optional: Session / cookie handling, caching ... (Maybe not „pure“ REST)
  • 38. PRESTON client • getResourceNamed: aURI queryParameters: aDictionary • postResource: anObject toResourceNamed: aURI • deleteResourceNamed: aURI • getOptionsForResourceNamed: aURI • handles session cookies (optional)
  • 39. PRESTON client • Mapping between Resource (e.g. XML) and Smalltalk objects • Optional caching (URI → object) • Proxies for hyperlinks (linked resource is only fetched if needed) • Can act as database client to a RESTful web service
  • 40. Building a REST Server • Extends several components of SST HTTP Server • Is very similar to a servlet container (it serves resources with a certain URI) • Adds marshalling, naming and more
  • 41. SST Building Blocks SstServerApplicationContext SstBasicServer containerKey sessionManagerConfig. attributes applicationContexts sessionManagers initializeRequest: handlesRequest: startUp SstHttpSessionManager shutDown processClientRequest: basicProcessRequest: createSessionForRequest: processRequest: createCookieForSession: SstHttpServer cookieFromRequestHeader... SstHttpServletEngine
  • 42. PRESTON Server SstServerApplicationContext SstBasicServer containerKey sessionManagerConfig. attributes applicationContexts sessionManagers initializeRequest: handlesRequest: startUp SstHttpSessionManager shutDown processClientRequest: basicProcessRequest: createSessionForRequest: processRequest: createCookieForSession: SstHttpServer cookieFromRequestHeader... PrestonResourceManager PrestonApplicationContext supportedHttpMethods resourceManagers PrestonServer pathSegment xmlMappingSpec rootObject handleGETRequest.. handlePostRequest...
  • 43. Demos • Yahoo! Traffic Client • Yahoo! Traffic Client on a Seaside Server • Todomatic Server & Client
  • 44. GET MapsService/V1/trafficData with request parameters PRESTON Client Yahoo! Traffic REST API http://local.yahooapis.com/ HTTP Application Logic Response with XML Sample Request URI: http://local.yahooapis.com/MapsService/V1/trafficData? appid=YdnDemo&street=701+First+Ave&city=Sunnyvale&state=CA VA Smalltalk Image
  • 45. ith eventually w ody a message b ML containing X document GET users/joachim/todolists POST users/joachim/todolists HTTP Client OODB Todomatic PUT users/joachim * Web Browser RESTful Server * PRESTON Smalltalk client VA Smalltalk Image * Any other HTTP Client TodoLists and TodoItems nse HTTP Respo l with optiona ent XML Docum User TodoList TodoItem
  • 47. RESTful Web Services • Anywhere on the web today and growing • Far less complex than Web Services • HTTP standard all the way down • Can be used for Internet applications as well as for internal systems • Integration • Scaling
  • 48. VA Smalltalk and RESTful Web Services • Most Web Services are CRUD operations • Integration today mostly means combining HTTP with XML or other text formats • VA ST provides all the building blocks • Some extensions needed • Can be combined with Seaside easily • Mashup your own services
  • 49. Questions? chel im Tu g 1 Joach erwe Flied rmany g, Ge ik.de sbur tfabr dwig bjek 40 Lu el@o ik.de tfabr 716 tuch objek j ww. w More info on my blog: www.joachim-tuchel.de

Notas del editor