SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
Helma-Workshop
       Philipp Naderer



      ASE-Projekt: Tenez
     http://www.tenez.at
   philipp.naderer@tenez.at
Demo-Distribution


http://tenez.at/downloads/helma-1.6.3-inafara.zip
Helma?

JavaScript Web Application Server

Open Source – BSD-Lizenz

Mozilla Rhino zum Interpretieren

  Rhino ist in der J2SE 6 fest verankert

Helma ist anders.
Helma ist anders!
Prototyp-basiertes Objekthandling

  Ganz grob gesagt: Prototype = Klasse

Prototypen bestimmen Applikations-Layout

REST-konform - jeder Ressource wird eine
URL zugeordnet.

  /photographers/leibovitz/
Helma ist anders!
Ruby on Rails:         Helma:
application            application
  -- models             -- Photographer
  -- controllers          |-   Photographer.js
                           |-   Photographer.actions.js
  -- helpers
                           |-   Photographer.macros.js
  -- views                |-   preview.skin
    -- photographer       |-   main.skin
    -- agency           -- Agency
    -- photo            -- Photo
Helma & Java
Rhino ermöglich Zugriff auf Java-Klassen

var url = new java.net.URL('http://orf.at‘);
var host = url.getHost();

var bigInt = new java.math.BigInteger('1000000‘);
res.write('Next prime: ' + bigInt.nextProbablePrime());




Zugriff auf alle möglichen Java-Libraries!

  Captchas, Chart-Rendering, ...
Request-Handling
Im Prototypen eine Funktion:
ProtoName.prototype.methodenname_action()

Wird gemapped auf: /objektId/methodenname
 Photo.prototype.delete_action = function() {
    // Request-Objekte:
    req
    res
    session
    root
 }

 URL:   /leibovitz/photos/1024/delete
Rendering
renderSkin(); renderSkinAsString();

Skins: /Prototype/skinname.skin

Macros: bezeichnung_macro(){...}

<li class="taskLine">
   <% this.text %>    <%// property %>
   <% this.status %> <%// status_macro() %>
</li>
DB-Mapping
Für jeden Prototype mit type.properties
# Photographer/type.properties
_db     = photoworld
_table = T_PHOTOGRAPHERS
_id     = PGR_ID
_parent = agency.photographers, root

name       =    PGR_NAME
birthday   =    PGR_BIRTHDAY

address         =      object(Address)
address.local   =      PGR_ADDRESS_FK
address.foreign =      ADR_ID

photo              =   collection(Photo)
photo.local        =   PGR_ID
photo.foreign      =   PHO_PHOTOGRAPHER_FK
REST-URLs
    /agency/magnum/photographers/philippnaderer

/Root/type.properties

agency            =     collection(Agency)
agency.accessname =     agencyAlias


          /Agency/type.properties
          _parent     = root.agency

          photographers            =     collection(Photographer)
          photographers.accessname =     photographerUsername
Vererbung
Alles, was für den Super-Prototypen definiert
wird, erbt der Sub-Prototype.

  Konstruktoren, Methoden, type.properties

_extends = SuperPrototypeName

Optional, aber üblich: Sub-Prototypen in selbe
Datenbank-Tabelle ablegen
# Dog/type.properties
_extends     = Animal
_prototype   = ANI_PROTOTYPE_NAME
_extensionId = Dog (String oder frei wählbarer Integer)
Vererbung
Collections:
Sub-Prototypes sind auch in Collections vom
Super-Prototype enthalten

allUpdates           = collection(Update)
allUpdates.local     = USR_ID
allUpdates.foreign   = UPD_CREATOR
                                                  Update

                       StatusUpdate         TaskUpdate
Caching
Obj1       Obj10

Obj2       Obj11

Obj3       Obj12
                   DB
           Obj13

           Obj14

           Obj15

new         old
Caching
Obj1        Obj10

Obj2        Obj11

Obj3        Obj12
                    DB
Obj26       Obj13

            Obj14

            Obj15

new          old
Caching
              Obj1                     Obj10

              Obj2                     Obj11

              Obj3                     Obj12
                                                             DB
              Obj26                    Obj13

              Obj27                    Obj14

              Obj28                    Obj15
cachesize/2                                    cachesize/2
                      cachesize = 12
              new                      old
Caching
                                     Obj1

                                     Obj2

                                     Obj3
                                                           DB
                                     Obj26

                                     Obj27

                                     Obj28
cachesize/2                                  cachesize/2
                    cachesize = 12
              new                    old
Sfârşit

(Ende)

Mais conteúdo relacionado

Semelhante a Helma Workshop

DOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, Backup
DOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, BackupDOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, Backup
DOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, BackupFromDual GmbH
 
Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!OPEN KNOWLEDGE GmbH
 
DOAG 2011: MySQL Replication
DOAG 2011: MySQL ReplicationDOAG 2011: MySQL Replication
DOAG 2011: MySQL ReplicationFromDual GmbH
 
FROSCON 2011: MySQL Replication
FROSCON 2011: MySQL ReplicationFROSCON 2011: MySQL Replication
FROSCON 2011: MySQL ReplicationFromDual GmbH
 
MySQL Replication for Beginners
MySQL Replication for BeginnersMySQL Replication for Beginners
MySQL Replication for BeginnersFromDual GmbH
 
Internet Briefing 2011: NoSQL with MySQL
Internet Briefing 2011: NoSQL with MySQLInternet Briefing 2011: NoSQL with MySQL
Internet Briefing 2011: NoSQL with MySQLFromDual GmbH
 
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & CoReady for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & CoOPEN KNOWLEDGE GmbH
 
Supersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: QuarkusSupersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: QuarkusOPEN KNOWLEDGE GmbH
 
DOAG: NoSQL with MySQL
DOAG: NoSQL with MySQLDOAG: NoSQL with MySQL
DOAG: NoSQL with MySQLFromDual GmbH
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsFromDual GmbH
 
OOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDBOOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDBTobias Trelle
 
Internet Briefing 2010: Performance Tuning & Scale-Out mit MySQL
Internet Briefing 2010: Performance Tuning & Scale-Out mit MySQLInternet Briefing 2010: Performance Tuning & Scale-Out mit MySQL
Internet Briefing 2010: Performance Tuning & Scale-Out mit MySQLFromDual GmbH
 

Semelhante a Helma Workshop (16)

DOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, Backup
DOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, BackupDOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, Backup
DOAG SIG: MySQL Replikation, Scale-Out, Master- Master Replikation, Backup
 
Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!Cloud-native and Enterprise Java? Hold my beer!
Cloud-native and Enterprise Java? Hold my beer!
 
DOAG 2011: MySQL Replication
DOAG 2011: MySQL ReplicationDOAG 2011: MySQL Replication
DOAG 2011: MySQL Replication
 
FROSCON 2011: MySQL Replication
FROSCON 2011: MySQL ReplicationFROSCON 2011: MySQL Replication
FROSCON 2011: MySQL Replication
 
MySQL Replication for Beginners
MySQL Replication for BeginnersMySQL Replication for Beginners
MySQL Replication for Beginners
 
Internet Briefing 2011: NoSQL with MySQL
Internet Briefing 2011: NoSQL with MySQLInternet Briefing 2011: NoSQL with MySQL
Internet Briefing 2011: NoSQL with MySQL
 
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & CoReady for the Future: Jakarta EE in Zeiten von Cloud Native & Co
Ready for the Future: Jakarta EE in Zeiten von Cloud Native & Co
 
Supersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: QuarkusSupersonic Java für die Cloud: Quarkus
Supersonic Java für die Cloud: Quarkus
 
DOAG: NoSQL with MySQL
DOAG: NoSQL with MySQLDOAG: NoSQL with MySQL
DOAG: NoSQL with MySQL
 
DSLs in Scala & DB4O
DSLs in Scala & DB4ODSLs in Scala & DB4O
DSLs in Scala & DB4O
 
Backbase Intro
Backbase IntroBackbase Intro
Backbase Intro
 
NoSQL with MySQL
NoSQL with MySQLNoSQL with MySQL
NoSQL with MySQL
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
jBPM & Drools
jBPM & DroolsjBPM & Drools
jBPM & Drools
 
OOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDBOOP 2013: Praktische Einführung in MongoDB
OOP 2013: Praktische Einführung in MongoDB
 
Internet Briefing 2010: Performance Tuning & Scale-Out mit MySQL
Internet Briefing 2010: Performance Tuning & Scale-Out mit MySQLInternet Briefing 2010: Performance Tuning & Scale-Out mit MySQL
Internet Briefing 2010: Performance Tuning & Scale-Out mit MySQL
 

Helma Workshop

  • 1. Helma-Workshop Philipp Naderer ASE-Projekt: Tenez http://www.tenez.at philipp.naderer@tenez.at
  • 3. Helma? JavaScript Web Application Server Open Source – BSD-Lizenz Mozilla Rhino zum Interpretieren Rhino ist in der J2SE 6 fest verankert Helma ist anders.
  • 4. Helma ist anders! Prototyp-basiertes Objekthandling Ganz grob gesagt: Prototype = Klasse Prototypen bestimmen Applikations-Layout REST-konform - jeder Ressource wird eine URL zugeordnet. /photographers/leibovitz/
  • 5. Helma ist anders! Ruby on Rails: Helma: application application -- models -- Photographer -- controllers |- Photographer.js |- Photographer.actions.js -- helpers |- Photographer.macros.js -- views |- preview.skin -- photographer |- main.skin -- agency -- Agency -- photo -- Photo
  • 6. Helma & Java Rhino ermöglich Zugriff auf Java-Klassen var url = new java.net.URL('http://orf.at‘); var host = url.getHost(); var bigInt = new java.math.BigInteger('1000000‘); res.write('Next prime: ' + bigInt.nextProbablePrime()); Zugriff auf alle möglichen Java-Libraries! Captchas, Chart-Rendering, ...
  • 7. Request-Handling Im Prototypen eine Funktion: ProtoName.prototype.methodenname_action() Wird gemapped auf: /objektId/methodenname Photo.prototype.delete_action = function() { // Request-Objekte: req res session root } URL: /leibovitz/photos/1024/delete
  • 8. Rendering renderSkin(); renderSkinAsString(); Skins: /Prototype/skinname.skin Macros: bezeichnung_macro(){...} <li class="taskLine"> <% this.text %> <%// property %> <% this.status %> <%// status_macro() %> </li>
  • 9. DB-Mapping Für jeden Prototype mit type.properties # Photographer/type.properties _db = photoworld _table = T_PHOTOGRAPHERS _id = PGR_ID _parent = agency.photographers, root name = PGR_NAME birthday = PGR_BIRTHDAY address = object(Address) address.local = PGR_ADDRESS_FK address.foreign = ADR_ID photo = collection(Photo) photo.local = PGR_ID photo.foreign = PHO_PHOTOGRAPHER_FK
  • 10. REST-URLs /agency/magnum/photographers/philippnaderer /Root/type.properties agency = collection(Agency) agency.accessname = agencyAlias /Agency/type.properties _parent = root.agency photographers = collection(Photographer) photographers.accessname = photographerUsername
  • 11. Vererbung Alles, was für den Super-Prototypen definiert wird, erbt der Sub-Prototype. Konstruktoren, Methoden, type.properties _extends = SuperPrototypeName Optional, aber üblich: Sub-Prototypen in selbe Datenbank-Tabelle ablegen # Dog/type.properties _extends = Animal _prototype = ANI_PROTOTYPE_NAME _extensionId = Dog (String oder frei wählbarer Integer)
  • 12. Vererbung Collections: Sub-Prototypes sind auch in Collections vom Super-Prototype enthalten allUpdates = collection(Update) allUpdates.local = USR_ID allUpdates.foreign = UPD_CREATOR Update StatusUpdate TaskUpdate
  • 13. Caching Obj1 Obj10 Obj2 Obj11 Obj3 Obj12 DB Obj13 Obj14 Obj15 new old
  • 14. Caching Obj1 Obj10 Obj2 Obj11 Obj3 Obj12 DB Obj26 Obj13 Obj14 Obj15 new old
  • 15. Caching Obj1 Obj10 Obj2 Obj11 Obj3 Obj12 DB Obj26 Obj13 Obj27 Obj14 Obj28 Obj15 cachesize/2 cachesize/2 cachesize = 12 new old
  • 16. Caching Obj1 Obj2 Obj3 DB Obj26 Obj27 Obj28 cachesize/2 cachesize/2 cachesize = 12 new old