SlideShare une entreprise Scribd logo
1  sur  62
Télécharger pour lire hors ligne
5. Seaside
ST — Seaside




      Roadmap




      >        Introduction
               — Web applications / Overview
               — Installation
      > Control Flow
      > Components
      > Composition




       Original lecture notes by Lukas Renggli


      Lukas Renggli and Marcus Denker            5.2
ST — Seaside




      Roadmap




      >        Introduction
               — Web applications / Overview
               — Installation
      > Control Flow
      > Components
      > Composition




      Lukas Renggli and Marcus Denker          5.3
ST — Seaside




      Introduction: Web Applications

      Example: Adding two numbers




      Lukas Renggli and Marcus Denker   5.4
ST — Seaside




      What is going on?


        <form action=“second.html”>
           <input type=“text” name=“value1”>             First.hml
           <input type=“submit” name=“OK”>
        </form>

        <form action=“result.html”>
                                                       second.hml
          <input type=“hidden”
                       name=“value1” value=“<% value1 %>”>
        </form>


        <p>                                              result.hml
          <% value1 + value2 %>
        </p>

      Lukas Renggli and Marcus Denker                            5.5
ST — Seaside




      Control Flow:
           HTTP request-response

                                           GET first.html

                                                                      first.html

                                        <a href=”second.html?number1=...”
         User:
       Web browser

                                    GET second.html?number1=...


                                                                    second.html

                                        <a href=”result.html?number1=...&number2=...”
      Lukas Renggli and Marcus Denker                                             5.6
ST — Seaside




      Something is wrong…



      >        Control-flow quite arcane
               — Remember GOTO?
               — We do not care about HTTP!

      >        How to debug that?

      >        And what about
               — Back button?
               — Copy of URL (second browser)?



      Lukas Renggli and Marcus Denker            5.7
ST — Seaside




      What we want


      >        Why not this?


          go
                |number1 number2 |

                number1 := self request: ‘First Number’.
                number2 := self request: ‘Second Number’.

                self inform: ‘The result is ‘,
                            (number1 + number2) asString




      Lukas Renggli and Marcus Denker                       5.8
ST — Seaside




      Seaside: Features




      >        Sessions as continuous piece of code
      >        XHTML/CSS building
      >        Callback based event model
      >        Composition and reuse
      >        Debugging and Development tools




      Lukas Renggli and Marcus Denker                 5.9
ST — Seaside




      XHTML Building


        html div id:          ‘title’; with: ‘Title’
        html div id:          ‘list’; with: [
           html span          class: ‘item’; with: ‘Item 1’.
           html span          class: ‘item’; with: ‘Item 2’.
        ]




        <div id=“title”>Title</div>
        <div if=“list”>
           <span class=“item”>Item 1</span>
           <span class=“item”>Item 2</span>
        </div>


      Lukas Renggli and Marcus Denker                          5.10
ST — Seaside




      CSS


      >        CSS Zengarden: http://csszengarden.com




      Lukas Renggli and Marcus Denker                   5.11
ST — Seaside




      Callback Event Model


        Example3>>renderContentOn: html
                      html form: [
                      html submitButton
                      callback: [ self inform: ‘Hello’ ];
                      text: ‘Say Hello’ ]




        ....
        <form action="/seaside/example2" method="post">
        <input type="hidden" name="_s" value="JBbTXBnPaTLOjcjI" class="hidden"/>
        <input type="hidden" name="_k" value="FFQrpnBg" class="hidden" />
        <input type="submit" name="1" value="Say Hello" class="submit" />
        </form>
        ....



      Lukas Renggli and Marcus Denker                                              5.12
ST — Seaside




      Composition + Reuse




      Example:
        Multicounter



      More later!




      Lukas Renggli and Marcus Denker   5.13
ST — Seaside




      Example: SqueakSource




      Lukas Renggli and Marcus Denker   5.14
ST — Seaside




      Example: DabbleDB




      Dabbledb.com




      Lukas Renggli and Marcus Denker   5.15
ST — Seaside




      Example: CMSBox




      cmsbox.ch




      Lukas Renggli and Marcus Denker   5.16
ST — Seaside




      Roadmap




      >        Introduction
               — Web applications / Overview
               — Installation
      > Control Flow
      > Components
      > Composition




      Lukas Renggli and Marcus Denker          5.17
ST — Seaside




      Installing Seaside



      >        Easy: Get from
               — http://www.iam.unibe.ch/~scg/Teaching/Smalltalk/Exercises/05Seaside/
               — For the config tool: user: admin, passwd: seaside

      >        Or install by hand
               —   Install Seaside 2.8a via SqueakMap
               —   Update using Monticello
               —   WAKom startOn: 8080
               —   Point browser to http://localhost:8080/seaside




      Lukas Renggli and Marcus Denker                                                   5.18
ST — Seaside




      Seaside


               http://localhost:8080/seaside




      Lukas Renggli and Marcus Denker          5.19
ST — Seaside




      Roadmap




      >        Introduction
               — Web applications / Overview
               — Installation
      > Control Flow
      > Components
      > Composition




      Lukas Renggli and Marcus Denker          5.20
ST — Seaside




      2. Control Flow




      >        Defining control flow

      >        Convenience methods

      >        Call / Answer

      >        Transactions



      Lukas Renggli and Marcus Denker   5.21
ST — Seaside




      Defining Flow




      >        Create a subclass of WATask
               — Implement the method #go
               — Split the method #go into smaller parts to ensure readability

      >        Tasks are a special kind of component
               — No visual representation
               — Define a logical flow (#go)
               — Call other components for output




      Lukas Renggli and Marcus Denker                                            5.22
ST — Seaside




      Convenience Methods




      > #inform: aString
      > #confirm: aString
      > #request: aString
      > #request:label:default:




      Lukas Renggli and Marcus Denker   5.23
ST — Seaside




      Call and Answer




      >        #call: aComponent
               — Transfer control to aComponent

      >        #answer: anObject
               — anObject will be returned from #call:
               — Receiving component will be removed




      Lukas Renggli and Marcus Denker                    5.24
ST — Seaside




      Call and Answer


                     Client                      Server
                                        A>>go
                                           x := self call: B
                           A               x asString.



                                        B>>go
                                           …
                            B              self answer: 77.



                                        A>>go
                           A               x := self call: B.
                                           x astring.
                                                    -> 77
      Lukas Renggli and Marcus Denker                           5.25
ST — Seaside




      Transactions




      > Sometimes it is required to prevent the user from going
        back within a flow
      > Calling #isolate: treats the flow defined in the block as a
        transaction
      > Users are able to move back and forth within the
        transaction, but once completed, they cannot go back
        anymore




      Lukas Renggli and Marcus Denker                               5.26
ST — Seaside




      Example for #isolate:




        self isolate: [
           self doShopping.
           self collectPaymentInfo].
        Self showConfirmation.




      Lukas Renggli and Marcus Denker   5.27
ST — Seaside




      Roadmap




      >        Introduction
               — Web applications / Overview
               — Installation
      > Control Flow
      > Components
      > Composition




      Lukas Renggli and Marcus Denker          5.28
ST — Seaside




      3. Components




      >        Rendering
               — XHTML
               — CSS
      >        Callbacks
               — Anchor
               — Form
      >        Customization



      Lukas Renggli and Marcus Denker   5.29
ST — Seaside




      Components




      > Components are the Views (and Controllers) of Seaside
        applications.
      > Components keep their state (model and state of user-
        interface) in instance-variables.
      > Components define the visual appearance and handle
        user interactions




      Lukas Renggli and Marcus Denker                           5.30
ST — Seaside




      Building Components




      > Components are created by subclassing WAComponent
      > Add instance-variables to hold your model and user-
        interface state
      > Put view related methods in a category called rendering
      > Put controller related methods into method categories
        named accessing, actions, private




      Lukas Renggli and Marcus Denker                             5.31
ST — Seaside




      Rendering



      > XHTML is built programmatically.
      > This process is called rendering.


      >        Create a method called #renderContentOn:



                 SomeComponent>>renderContentOn: html
                    html text: ‘Hello World’



      Lukas Renggli and Marcus Denker                     5.32
ST — Seaside




      Text Rendering




      >        Render a string:
                      html text: ‘My Text’

      >        Render an un-escaped string:
                      html html: ‘<foo>Zork</foo>’

      >        Render any object (using double dispatch):
                      html render: 1


      Lukas Renggli and Marcus Denker                       5.33
ST — Seaside




      Canvas and Brushes




      >        html parameter is instance of WARenderingCanvas
               — Basic html output
               — Render logic

      >        Canvas provides brushes
               — For rendering html tags




      Lukas Renggli and Marcus Denker                            5.34
ST — Seaside




      Basic Brushes




      >        Render a new line <br />:
                      html break.

      >        Render a horizontal Rule <hr />:

                      html horizontalRule.

      >        Render a non-breaking space &nbsp;:
                      html space.


      Lukas Renggli and Marcus Denker                5.35
ST — Seaside




      Using Brushes


      1. Ask the canvas for a div brush

                html div.

      2. Configure the brush, e.g. set attributes
                html div class: ‘beautiful’.

      3. Render the contents of the tag-brush:
                html div
                  class: ‘beautiful’;
                  with: ‘Hello World’.

      Lukas Renggli and Marcus Denker              5.36
ST — Seaside




      Painting with Brushes


                       Seaside                  XHTML

         html div                       <div></div>



         html div                       <div class=“beautiful”>
           class: ‘beautiful’           </div>



         html div                       <div class=“beautiful”>
           class: ‘beautiful’;          Hello World
           with: ‘Hello World’.         </div>

      Lukas Renggli and Marcus Denker                             5.37
ST — Seaside




      Nesting Brushes




      >        Render a text in bold:
                 html strong with: ‘My Text’.

      >        Render a text in italic
                  html emphasis with: ‘My Text’.

      >        Render a text in bold and italic:
                  html strong with: [
                    html emphasis with: ‘My Text’].

      Lukas Renggli and Marcus Denker                 5.38
ST — Seaside




      Nesting Brushes



      > To nest brushes use the message #with:.
      > Always send #with: as the last message in the
        configuration cascade.
      > The argument of #with: is rendered using double-
        dispatch, therefore any object can be passed as an
        argument.
      > To nest tags, pass a block that renders the elements to
        nest.



      Lukas Renggli and Marcus Denker                             5.39
ST — Seaside




      Nesting Brushes


      >        Render nested divs:
                 html div id: ‘frame’; with: [
                    html div id: ‘contents’; with: …
                    html div id: ‘sidebar’; with: … ].


      >        Render a list:
                 html orderedList with: [
                    html listItem with: …
                    html listItem with: … ].



      Lukas Renggli and Marcus Denker                    5.40
ST — Seaside




      Rendering Pitfalls I




      > Donʼt change the state of the application while
        rendering, unless you have a really good reason to do
        so.
      > Rendering is a read-only phase.
      > Donʼt put all your rendering code into a single method.
        Split it into small parts and chose a method name
        following the pattern #render*On:




      Lukas Renggli and Marcus Denker                             5.41
ST — Seaside




      Rendering Pitfalls II




      >        Rendering is a read-ony phase.
               — Donʼt send #renderContentOn: from your own code, use
                 #render: instead.
               — Donʼt send #call: and #answer: while rendering


      >        Always use #with: as the last message in the
               configuration cascase of your brush




      Lukas Renggli and Marcus Denker                                   5.42
ST — Seaside




      Anchor Callback



      >        Ask the rendering canvas for an anchor and configure it
               with a callback-block:

               html anchor
                  callback: [self someAction]
                  with: ‘Some Action’].


      >        The callback-block is cached and will be executed later.



      Lukas Renggli and Marcus Denker                                     5.43
ST — Seaside




      Anchor Example



               WACounter>>renderContentOn: html
                  html heading
                       level: 1;
                       with: self count.
                  html anchor
                       callback: [self increase];
                       with: ‘++’.
                  html space.
                  html anchor
                       callback: [self decrease];
                       with: ‘--’.



      Lukas Renggli and Marcus Denker               5.44
ST — Seaside




      Forms



      >        Render a form around your form elements:
                                        html form: [ … ]

      >        Put the Form elements inside the form:

                 html form: [
                    html textInput
                      value: text;
                      callback: [:value | text := value].
                    html submitButton ].


      Lukas Renggli and Marcus Denker                       5.45
ST — Seaside




      More Brushes with Callbacks..




      >        Text Input / Text Area
      >        Submit Button
      >        Check-Box
      >        Radio Group
      >        Select List
      >        File-Upload

               Have a look at the tests!


      Lukas Renggli and Marcus Denker      5.46
ST — Seaside




      Register new Component / Task



      >        Create method #canBeRoot returning true on class
               side

      >        Register using Seaside configuration interface.

      >        Or call #registerAsApplication: in the class-side
               #initialize




      Lukas Renggli and Marcus Denker                              5.47
ST — Seaside




      Roadmap




      >        Introduction
               — Web applications / Overview
               — Installation
      > Control Flow
      > Components
      > Composition




      Lukas Renggli and Marcus Denker          5.48
ST — Seaside




      4. Compositon




      >        Backtracking

      >        Subcomponents

      >        Widgets




      Lukas Renggli and Marcus Denker   5.49
ST — Seaside




      Backtracking State




      > Seaside does not backtrack state by default.
      > Often it is not obvious whether an object should be
        backtracked or not. Mostly this has to be decided by the
        developer on a per-object basis.
      > Any object can be declared to be backtracked.




      Lukas Renggli and Marcus Denker                              5.50
ST — Seaside




      Shopping Cart Problem




      >        Online Bookstore (without backtracking)
               — When using the back-button, usually the items should not be
                 removed from the cart; just resume browsing from the old
                 location.

      >        Flight Reservation System (with backtracking)
               — When using the back-button, usually you want to check other
                 flights, this means the selected flight should be removed.




      Lukas Renggli and Marcus Denker                                          5.51
ST — Seaside




      Register Object




      > Implement method #states that returns an Array that
        contains your object.
      > This will backtrack the instance-variables of the objects,
        not the objects themselves


               SomeComponent>>#states
                  ^ Array with: model.




      Lukas Renggli and Marcus Denker                                5.52
ST — Seaside




      Subcomponents




      > It is common for a component to display instances of
        other components.
      > Components can be nested into each other using the
        composite pattern.
      > A subcomponent is displayed using the method
        #render: on the canvas.




      Lukas Renggli and Marcus Denker                          5.53
ST — Seaside




      Initialize Children




      > Subcomponents are usually stored within instance
        variables of the parent component.
      > Subcomponents are commonly created lazily or as part
        of the components #initialize method.

               SomeComponent>>initialize
                  super initialize.
                  counter := WACounter new.



      Lukas Renggli and Marcus Denker                          5.54
ST — Seaside




      Enable Children




      > Parent Components must implement a #children
        method returning a collection of subcomponents that
        they might display.
      > If you fail to specify #children correctly, Seaside will
        raise an exception.

               SomeComponent>>children
                  ^ Array with: counter



      Lukas Renggli and Marcus Denker                              5.55
ST — Seaside




      Render Children




      > Children are rendered by sending the message
        #render: to the rendering canvas.
      > Never directly send #renderContentOn: to the
        subcomponent.
               SomeComponent>>renderContentOn: html
                  html heading level: 1; with: ‘My Counter’.
                  html render: counter.



      Lukas Renggli and Marcus Denker                          5.56
ST — Seaside




      Widgets




      > Components can be reused in different contexts within
        different applications.
      > Seaside is shipped with a small collection of widgets
        ready to use.
      > Load and use widgets that have been developed by the
        Seaside community.
      > Write your own widgets that exactly fit your needs




      Lukas Renggli and Marcus Denker                           5.57
ST — Seaside




      Widgets: Examples




      >        Batched List

      >        Tab Panel

      >        Calendar
                                        Have a look at the classes in
                                              Seaside-Components-Widgets


      Lukas Renggli and Marcus Denker                                      5.58
ST — Seaside




      Custom Widgets




      > Create a new component.
      > Add methods to specify domain-model,
        subcomponents, properties…
      > Assign CSS names/classes to make it skinnable with
        css style-sheet.
               — Implement method #style to return CSS for component
      >        Write tests and small example applications.




      Lukas Renggli and Marcus Denker                                  5.59
ST — Seaside




      There is more..




      >        Development Tools
               — Demo in the Exercise Session (Halo, Configuration…)
               — Debugging: Next Lecture

      >        AJAX and script.aculo.us

      >        Persistency (Databases)




      Lukas Renggli and Marcus Denker                                 5.60
ST — Seaside




      Literature


      >        HPI Seaside Tutorial:
               — http://www.swa.hpi.uni-potsdam.de/seaside/tutorial

      >        Ducasse, Lienhard, Renggli: Seaside: A Flexible
               Environment for Building Dynamic Web
               Applications (IEEE Software, vol. 24 no.5)

      >        Ducasse, Lienhard, Renggli: Seaside, a Multiple
               Control Flow Web Application Framework
               (Proceedings ISC04)

      >        …. More at Seaside.st

      Lukas Renggli and Marcus Denker                                 5.61
ST — Seaside




      License

      >        http://creativecommons.org/licenses/by-sa/3.0/



                                        Attribution-ShareAlike 3.0 Unported
           You are free:
                to Share — to copy, distribute and transmit the work
                to Remix — to adapt the work

           Under the following conditions:
                Attribution. You must attribute the work in the manner specified by the author or
                licensor (but not in any way that suggests that they endorse you or your use of the
                work).
                Share Alike. If you alter, transform, or build upon this work, you may distribute the
                resulting work only under the same, similar or a compatible license.
           For any reuse or distribution, you must make clear to others the license terms of this work.
             The best way to do this is with a link to this web page.
           Any of the above conditions can be waived if you get permission from the copyright holder.
           Nothing in this license impairs or restricts the author's moral rights.

      Lukas Renggli and Marcus Denker                                                                     5.62

Contenu connexe

Similaire à Lecture: Seaside

Getting Started with NuoDB Community Edition
Getting Started with NuoDB Community Edition Getting Started with NuoDB Community Edition
Getting Started with NuoDB Community Edition NuoDB
 
Dataflow - A Unified Model for Batch and Streaming Data Processing
Dataflow - A Unified Model for Batch and Streaming Data ProcessingDataflow - A Unified Model for Batch and Streaming Data Processing
Dataflow - A Unified Model for Batch and Streaming Data ProcessingDoiT International
 
New Docker Features for Orchestration and Containers
New Docker Features for Orchestration and ContainersNew Docker Features for Orchestration and Containers
New Docker Features for Orchestration and ContainersJeff Anderson
 
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data ProcessingCloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data ProcessingDoiT International
 
Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...
Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...
Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...Codium
 
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s WorkloadsUsing SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s WorkloadsScyllaDB
 
FPC for the Masses - CoRIIN 2018
FPC for the Masses - CoRIIN 2018FPC for the Masses - CoRIIN 2018
FPC for the Masses - CoRIIN 2018Xavier Mertens
 
Web performance Part 1 "Networking theoretical basis"
Web performance Part 1 "Networking theoretical basis"Web performance Part 1 "Networking theoretical basis"
Web performance Part 1 "Networking theoretical basis"Binary Studio
 
Software Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience ReportSoftware Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience ReportMarcus Denker
 
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLYENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLYCDNetworks
 
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea LuzzardiWhat's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea LuzzardiDocker, Inc.
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiMike Goelzer
 
Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...
Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...
Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...mCloud
 
Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Robert Lemke
 
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"Philip Tellis
 
Continuous Integration with Robot Sweatshop
Continuous Integration with Robot SweatshopContinuous Integration with Robot Sweatshop
Continuous Integration with Robot SweatshopJustin Scott
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerJeff Anderson
 
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, DockerTroubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, DockerDocker, Inc.
 
Angular + Components
Angular + ComponentsAngular + Components
Angular + ComponentsShawn McKay
 
CI/CD and TDD in deploying kamailio
CI/CD and TDD in deploying kamailioCI/CD and TDD in deploying kamailio
CI/CD and TDD in deploying kamailioAleksandar Sosic
 

Similaire à Lecture: Seaside (20)

Getting Started with NuoDB Community Edition
Getting Started with NuoDB Community Edition Getting Started with NuoDB Community Edition
Getting Started with NuoDB Community Edition
 
Dataflow - A Unified Model for Batch and Streaming Data Processing
Dataflow - A Unified Model for Batch and Streaming Data ProcessingDataflow - A Unified Model for Batch and Streaming Data Processing
Dataflow - A Unified Model for Batch and Streaming Data Processing
 
New Docker Features for Orchestration and Containers
New Docker Features for Orchestration and ContainersNew Docker Features for Orchestration and Containers
New Docker Features for Orchestration and Containers
 
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data ProcessingCloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
 
Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...
Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...
Learned lessons in real world projects by Jordi Anguela at Mallorca Software ...
 
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s WorkloadsUsing SLOs for Continuous Performance Optimizations of Your k8s Workloads
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
 
FPC for the Masses - CoRIIN 2018
FPC for the Masses - CoRIIN 2018FPC for the Masses - CoRIIN 2018
FPC for the Masses - CoRIIN 2018
 
Web performance Part 1 "Networking theoretical basis"
Web performance Part 1 "Networking theoretical basis"Web performance Part 1 "Networking theoretical basis"
Web performance Part 1 "Networking theoretical basis"
 
Software Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience ReportSoftware Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience Report
 
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLYENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
 
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea LuzzardiWhat's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
 
Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...
Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...
Developers’ mDay 2021: Andrea Bjelogrlić, Sysbee – Tips, tricks and debugging...
 
Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022
 
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
 
Continuous Integration with Robot Sweatshop
Continuous Integration with Robot SweatshopContinuous Integration with Robot Sweatshop
Continuous Integration with Robot Sweatshop
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support Engineer
 
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, DockerTroubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
 
Angular + Components
Angular + ComponentsAngular + Components
Angular + Components
 
CI/CD and TDD in deploying kamailio
CI/CD and TDD in deploying kamailioCI/CD and TDD in deploying kamailio
CI/CD and TDD in deploying kamailio
 

Plus de Marcus Denker

ConstantBlocks in Pharo11
ConstantBlocks in Pharo11ConstantBlocks in Pharo11
ConstantBlocks in Pharo11Marcus Denker
 
First Class Variables as AST Annotations
First Class Variables as AST AnnotationsFirst Class Variables as AST Annotations
First Class Variables as AST AnnotationsMarcus Denker
 
Supporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportSupporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportMarcus Denker
 
Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Marcus Denker
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerMarcus Denker
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksMarcus Denker
 
Improving code completion for Pharo
Improving code completion for PharoImproving code completion for Pharo
Improving code completion for PharoMarcus Denker
 
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinksVUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinksMarcus Denker
 
Lecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksMarcus Denker
 
Open-Source: An Infinite Game
Open-Source: An Infinite GameOpen-Source: An Infinite Game
Open-Source: An Infinite GameMarcus Denker
 
PharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoPharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoMarcus Denker
 
Feedback Loops in Practice
Feedback Loops in PracticeFeedback Loops in Practice
Feedback Loops in PracticeMarcus Denker
 

Plus de Marcus Denker (20)

Soil And Pharo
Soil And PharoSoil And Pharo
Soil And Pharo
 
ConstantBlocks in Pharo11
ConstantBlocks in Pharo11ConstantBlocks in Pharo11
ConstantBlocks in Pharo11
 
Demo: Improved DoIt
Demo: Improved DoItDemo: Improved DoIt
Demo: Improved DoIt
 
First Class Variables as AST Annotations
First Class Variables as AST AnnotationsFirst Class Variables as AST Annotations
First Class Variables as AST Annotations
 
Supporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportSupporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo Support
 
Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Variables in Pharo
Variables in PharoVariables in Pharo
Variables in Pharo
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinks
 
Improving code completion for Pharo
Improving code completion for PharoImproving code completion for Pharo
Improving code completion for Pharo
 
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinksVUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
 
Slot Composition
Slot CompositionSlot Composition
Slot Composition
 
Lecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinks
 
PHARO IOT
PHARO IOTPHARO IOT
PHARO IOT
 
Open-Source: An Infinite Game
Open-Source: An Infinite GameOpen-Source: An Infinite Game
Open-Source: An Infinite Game
 
Lecture: MetaLinks
Lecture: MetaLinksLecture: MetaLinks
Lecture: MetaLinks
 
PharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoPharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to Pharo
 
Feedback Loops in Practice
Feedback Loops in PracticeFeedback Loops in Practice
Feedback Loops in Practice
 
Pharo6 - ESUG17
Pharo6 - ESUG17Pharo6 - ESUG17
Pharo6 - ESUG17
 
Pharo6
Pharo6Pharo6
Pharo6
 

Dernier

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
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
 
"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
 
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
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Dernier (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
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)
 
"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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

Lecture: Seaside

  • 2. ST — Seaside Roadmap > Introduction — Web applications / Overview — Installation > Control Flow > Components > Composition Original lecture notes by Lukas Renggli Lukas Renggli and Marcus Denker 5.2
  • 3. ST — Seaside Roadmap > Introduction — Web applications / Overview — Installation > Control Flow > Components > Composition Lukas Renggli and Marcus Denker 5.3
  • 4. ST — Seaside Introduction: Web Applications Example: Adding two numbers Lukas Renggli and Marcus Denker 5.4
  • 5. ST — Seaside What is going on? <form action=“second.html”> <input type=“text” name=“value1”> First.hml <input type=“submit” name=“OK”> </form> <form action=“result.html”> second.hml <input type=“hidden” name=“value1” value=“<% value1 %>”> </form> <p> result.hml <% value1 + value2 %> </p> Lukas Renggli and Marcus Denker 5.5
  • 6. ST — Seaside Control Flow: HTTP request-response GET first.html first.html <a href=”second.html?number1=...” User: Web browser GET second.html?number1=... second.html <a href=”result.html?number1=...&number2=...” Lukas Renggli and Marcus Denker 5.6
  • 7. ST — Seaside Something is wrong… > Control-flow quite arcane — Remember GOTO? — We do not care about HTTP! > How to debug that? > And what about — Back button? — Copy of URL (second browser)? Lukas Renggli and Marcus Denker 5.7
  • 8. ST — Seaside What we want > Why not this? go |number1 number2 | number1 := self request: ‘First Number’. number2 := self request: ‘Second Number’. self inform: ‘The result is ‘, (number1 + number2) asString Lukas Renggli and Marcus Denker 5.8
  • 9. ST — Seaside Seaside: Features > Sessions as continuous piece of code > XHTML/CSS building > Callback based event model > Composition and reuse > Debugging and Development tools Lukas Renggli and Marcus Denker 5.9
  • 10. ST — Seaside XHTML Building html div id: ‘title’; with: ‘Title’ html div id: ‘list’; with: [ html span class: ‘item’; with: ‘Item 1’. html span class: ‘item’; with: ‘Item 2’. ] <div id=“title”>Title</div> <div if=“list”> <span class=“item”>Item 1</span> <span class=“item”>Item 2</span> </div> Lukas Renggli and Marcus Denker 5.10
  • 11. ST — Seaside CSS > CSS Zengarden: http://csszengarden.com Lukas Renggli and Marcus Denker 5.11
  • 12. ST — Seaside Callback Event Model Example3>>renderContentOn: html html form: [ html submitButton callback: [ self inform: ‘Hello’ ]; text: ‘Say Hello’ ] .... <form action="/seaside/example2" method="post"> <input type="hidden" name="_s" value="JBbTXBnPaTLOjcjI" class="hidden"/> <input type="hidden" name="_k" value="FFQrpnBg" class="hidden" /> <input type="submit" name="1" value="Say Hello" class="submit" /> </form> .... Lukas Renggli and Marcus Denker 5.12
  • 13. ST — Seaside Composition + Reuse Example: Multicounter More later! Lukas Renggli and Marcus Denker 5.13
  • 14. ST — Seaside Example: SqueakSource Lukas Renggli and Marcus Denker 5.14
  • 15. ST — Seaside Example: DabbleDB Dabbledb.com Lukas Renggli and Marcus Denker 5.15
  • 16. ST — Seaside Example: CMSBox cmsbox.ch Lukas Renggli and Marcus Denker 5.16
  • 17. ST — Seaside Roadmap > Introduction — Web applications / Overview — Installation > Control Flow > Components > Composition Lukas Renggli and Marcus Denker 5.17
  • 18. ST — Seaside Installing Seaside > Easy: Get from — http://www.iam.unibe.ch/~scg/Teaching/Smalltalk/Exercises/05Seaside/ — For the config tool: user: admin, passwd: seaside > Or install by hand — Install Seaside 2.8a via SqueakMap — Update using Monticello — WAKom startOn: 8080 — Point browser to http://localhost:8080/seaside Lukas Renggli and Marcus Denker 5.18
  • 19. ST — Seaside Seaside http://localhost:8080/seaside Lukas Renggli and Marcus Denker 5.19
  • 20. ST — Seaside Roadmap > Introduction — Web applications / Overview — Installation > Control Flow > Components > Composition Lukas Renggli and Marcus Denker 5.20
  • 21. ST — Seaside 2. Control Flow > Defining control flow > Convenience methods > Call / Answer > Transactions Lukas Renggli and Marcus Denker 5.21
  • 22. ST — Seaside Defining Flow > Create a subclass of WATask — Implement the method #go — Split the method #go into smaller parts to ensure readability > Tasks are a special kind of component — No visual representation — Define a logical flow (#go) — Call other components for output Lukas Renggli and Marcus Denker 5.22
  • 23. ST — Seaside Convenience Methods > #inform: aString > #confirm: aString > #request: aString > #request:label:default: Lukas Renggli and Marcus Denker 5.23
  • 24. ST — Seaside Call and Answer > #call: aComponent — Transfer control to aComponent > #answer: anObject — anObject will be returned from #call: — Receiving component will be removed Lukas Renggli and Marcus Denker 5.24
  • 25. ST — Seaside Call and Answer Client Server A>>go x := self call: B A x asString. B>>go … B self answer: 77. A>>go A x := self call: B. x astring. -> 77 Lukas Renggli and Marcus Denker 5.25
  • 26. ST — Seaside Transactions > Sometimes it is required to prevent the user from going back within a flow > Calling #isolate: treats the flow defined in the block as a transaction > Users are able to move back and forth within the transaction, but once completed, they cannot go back anymore Lukas Renggli and Marcus Denker 5.26
  • 27. ST — Seaside Example for #isolate: self isolate: [ self doShopping. self collectPaymentInfo]. Self showConfirmation. Lukas Renggli and Marcus Denker 5.27
  • 28. ST — Seaside Roadmap > Introduction — Web applications / Overview — Installation > Control Flow > Components > Composition Lukas Renggli and Marcus Denker 5.28
  • 29. ST — Seaside 3. Components > Rendering — XHTML — CSS > Callbacks — Anchor — Form > Customization Lukas Renggli and Marcus Denker 5.29
  • 30. ST — Seaside Components > Components are the Views (and Controllers) of Seaside applications. > Components keep their state (model and state of user- interface) in instance-variables. > Components define the visual appearance and handle user interactions Lukas Renggli and Marcus Denker 5.30
  • 31. ST — Seaside Building Components > Components are created by subclassing WAComponent > Add instance-variables to hold your model and user- interface state > Put view related methods in a category called rendering > Put controller related methods into method categories named accessing, actions, private Lukas Renggli and Marcus Denker 5.31
  • 32. ST — Seaside Rendering > XHTML is built programmatically. > This process is called rendering. > Create a method called #renderContentOn: SomeComponent>>renderContentOn: html html text: ‘Hello World’ Lukas Renggli and Marcus Denker 5.32
  • 33. ST — Seaside Text Rendering > Render a string: html text: ‘My Text’ > Render an un-escaped string: html html: ‘<foo>Zork</foo>’ > Render any object (using double dispatch): html render: 1 Lukas Renggli and Marcus Denker 5.33
  • 34. ST — Seaside Canvas and Brushes > html parameter is instance of WARenderingCanvas — Basic html output — Render logic > Canvas provides brushes — For rendering html tags Lukas Renggli and Marcus Denker 5.34
  • 35. ST — Seaside Basic Brushes > Render a new line <br />: html break. > Render a horizontal Rule <hr />: html horizontalRule. > Render a non-breaking space &nbsp;: html space. Lukas Renggli and Marcus Denker 5.35
  • 36. ST — Seaside Using Brushes 1. Ask the canvas for a div brush html div. 2. Configure the brush, e.g. set attributes html div class: ‘beautiful’. 3. Render the contents of the tag-brush: html div class: ‘beautiful’; with: ‘Hello World’. Lukas Renggli and Marcus Denker 5.36
  • 37. ST — Seaside Painting with Brushes Seaside XHTML html div <div></div> html div <div class=“beautiful”> class: ‘beautiful’ </div> html div <div class=“beautiful”> class: ‘beautiful’; Hello World with: ‘Hello World’. </div> Lukas Renggli and Marcus Denker 5.37
  • 38. ST — Seaside Nesting Brushes > Render a text in bold: html strong with: ‘My Text’. > Render a text in italic html emphasis with: ‘My Text’. > Render a text in bold and italic: html strong with: [ html emphasis with: ‘My Text’]. Lukas Renggli and Marcus Denker 5.38
  • 39. ST — Seaside Nesting Brushes > To nest brushes use the message #with:. > Always send #with: as the last message in the configuration cascade. > The argument of #with: is rendered using double- dispatch, therefore any object can be passed as an argument. > To nest tags, pass a block that renders the elements to nest. Lukas Renggli and Marcus Denker 5.39
  • 40. ST — Seaside Nesting Brushes > Render nested divs: html div id: ‘frame’; with: [ html div id: ‘contents’; with: … html div id: ‘sidebar’; with: … ]. > Render a list: html orderedList with: [ html listItem with: … html listItem with: … ]. Lukas Renggli and Marcus Denker 5.40
  • 41. ST — Seaside Rendering Pitfalls I > Donʼt change the state of the application while rendering, unless you have a really good reason to do so. > Rendering is a read-only phase. > Donʼt put all your rendering code into a single method. Split it into small parts and chose a method name following the pattern #render*On: Lukas Renggli and Marcus Denker 5.41
  • 42. ST — Seaside Rendering Pitfalls II > Rendering is a read-ony phase. — Donʼt send #renderContentOn: from your own code, use #render: instead. — Donʼt send #call: and #answer: while rendering > Always use #with: as the last message in the configuration cascase of your brush Lukas Renggli and Marcus Denker 5.42
  • 43. ST — Seaside Anchor Callback > Ask the rendering canvas for an anchor and configure it with a callback-block: html anchor callback: [self someAction] with: ‘Some Action’]. > The callback-block is cached and will be executed later. Lukas Renggli and Marcus Denker 5.43
  • 44. ST — Seaside Anchor Example WACounter>>renderContentOn: html html heading level: 1; with: self count. html anchor callback: [self increase]; with: ‘++’. html space. html anchor callback: [self decrease]; with: ‘--’. Lukas Renggli and Marcus Denker 5.44
  • 45. ST — Seaside Forms > Render a form around your form elements: html form: [ … ] > Put the Form elements inside the form: html form: [ html textInput value: text; callback: [:value | text := value]. html submitButton ]. Lukas Renggli and Marcus Denker 5.45
  • 46. ST — Seaside More Brushes with Callbacks.. > Text Input / Text Area > Submit Button > Check-Box > Radio Group > Select List > File-Upload Have a look at the tests! Lukas Renggli and Marcus Denker 5.46
  • 47. ST — Seaside Register new Component / Task > Create method #canBeRoot returning true on class side > Register using Seaside configuration interface. > Or call #registerAsApplication: in the class-side #initialize Lukas Renggli and Marcus Denker 5.47
  • 48. ST — Seaside Roadmap > Introduction — Web applications / Overview — Installation > Control Flow > Components > Composition Lukas Renggli and Marcus Denker 5.48
  • 49. ST — Seaside 4. Compositon > Backtracking > Subcomponents > Widgets Lukas Renggli and Marcus Denker 5.49
  • 50. ST — Seaside Backtracking State > Seaside does not backtrack state by default. > Often it is not obvious whether an object should be backtracked or not. Mostly this has to be decided by the developer on a per-object basis. > Any object can be declared to be backtracked. Lukas Renggli and Marcus Denker 5.50
  • 51. ST — Seaside Shopping Cart Problem > Online Bookstore (without backtracking) — When using the back-button, usually the items should not be removed from the cart; just resume browsing from the old location. > Flight Reservation System (with backtracking) — When using the back-button, usually you want to check other flights, this means the selected flight should be removed. Lukas Renggli and Marcus Denker 5.51
  • 52. ST — Seaside Register Object > Implement method #states that returns an Array that contains your object. > This will backtrack the instance-variables of the objects, not the objects themselves SomeComponent>>#states ^ Array with: model. Lukas Renggli and Marcus Denker 5.52
  • 53. ST — Seaside Subcomponents > It is common for a component to display instances of other components. > Components can be nested into each other using the composite pattern. > A subcomponent is displayed using the method #render: on the canvas. Lukas Renggli and Marcus Denker 5.53
  • 54. ST — Seaside Initialize Children > Subcomponents are usually stored within instance variables of the parent component. > Subcomponents are commonly created lazily or as part of the components #initialize method. SomeComponent>>initialize super initialize. counter := WACounter new. Lukas Renggli and Marcus Denker 5.54
  • 55. ST — Seaside Enable Children > Parent Components must implement a #children method returning a collection of subcomponents that they might display. > If you fail to specify #children correctly, Seaside will raise an exception. SomeComponent>>children ^ Array with: counter Lukas Renggli and Marcus Denker 5.55
  • 56. ST — Seaside Render Children > Children are rendered by sending the message #render: to the rendering canvas. > Never directly send #renderContentOn: to the subcomponent. SomeComponent>>renderContentOn: html html heading level: 1; with: ‘My Counter’. html render: counter. Lukas Renggli and Marcus Denker 5.56
  • 57. ST — Seaside Widgets > Components can be reused in different contexts within different applications. > Seaside is shipped with a small collection of widgets ready to use. > Load and use widgets that have been developed by the Seaside community. > Write your own widgets that exactly fit your needs Lukas Renggli and Marcus Denker 5.57
  • 58. ST — Seaside Widgets: Examples > Batched List > Tab Panel > Calendar Have a look at the classes in Seaside-Components-Widgets Lukas Renggli and Marcus Denker 5.58
  • 59. ST — Seaside Custom Widgets > Create a new component. > Add methods to specify domain-model, subcomponents, properties… > Assign CSS names/classes to make it skinnable with css style-sheet. — Implement method #style to return CSS for component > Write tests and small example applications. Lukas Renggli and Marcus Denker 5.59
  • 60. ST — Seaside There is more.. > Development Tools — Demo in the Exercise Session (Halo, Configuration…) — Debugging: Next Lecture > AJAX and script.aculo.us > Persistency (Databases) Lukas Renggli and Marcus Denker 5.60
  • 61. ST — Seaside Literature > HPI Seaside Tutorial: — http://www.swa.hpi.uni-potsdam.de/seaside/tutorial > Ducasse, Lienhard, Renggli: Seaside: A Flexible Environment for Building Dynamic Web Applications (IEEE Software, vol. 24 no.5) > Ducasse, Lienhard, Renggli: Seaside, a Multiple Control Flow Web Application Framework (Proceedings ISC04) > …. More at Seaside.st Lukas Renggli and Marcus Denker 5.61
  • 62. ST — Seaside License > http://creativecommons.org/licenses/by-sa/3.0/ Attribution-ShareAlike 3.0 Unported You are free: to Share — to copy, distribute and transmit the work to Remix — to adapt the work Under the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. Any of the above conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the author's moral rights. Lukas Renggli and Marcus Denker 5.62