Your SlideShare is downloading. ×
0
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Helma Workshop
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Helma Workshop

486

Published on

My presentation for the JSUG at the TU Vienna.

My presentation for the JSUG at the TU Vienna.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
486
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Helma-Workshop Philipp Naderer ASE-Projekt: Tenez http://www.tenez.at philipp.naderer@tenez.at
  • 2. Demo-Distribution http://tenez.at/downloads/helma-1.6.3-inafara.zip
  • 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
  • 17. Sfârşit (Ende)

×