SlideShare a Scribd company logo
1 of 80
JavaScript 2 Enterprise
Edition
                          Slide
Me

_   Working at SinnerSchrader
_   Joose - JavaScript Meta Object System
_   http://nonblocking.io




                                            Slide 2
Me

_   Working at SinnerSchrader
_   Joose - JavaScript Meta Object System
_   http://nonblocking.io




                                      @cramforce

                                                   Slide 2
My employer asked me to say a
few kind words about
SinnerSchrader, so that you all
want to work there.
bla bla
SinnerSchrader: The Important
Facts




                                * Linden, 2006 5
                                           Slide
SinnerSchrader: The Important
Facts




                       1
                  Server side JS project
                      in production
                                           * Linden, 2006 5
                                                      Slide
SinnerSchrader: The Important
Facts




          2
Active CouchDB projects
                               1
                          Server side JS project
                              in production
                                                   * Linden, 2006 5
                                                              Slide
SinnerSchrader: The Important
Facts
          1
  Server side JS project
     in development




          2
Active CouchDB projects
                                1
                           Server side JS project
                               in production
                                                    * Linden, 2006 5
                                                               Slide
SinnerSchrader: The Important
Facts
          1
  Server side JS project
     in development




                             2
                                                      1
                   Erlang projects in planning




          2
Active CouchDB projects
                                                 Server side JS project
                                                     in production
                                                                          * Linden, 2006 5
                                                                                     Slide
SinnerSchrader: The Important
Facts
          1
                                        10 Mil $
  Server side JS project
     in development


                                                     in the bank



                             2
                                                      1
                   Erlang projects in planning




          2
Active CouchDB projects
                                                 Server side JS project
                                                     in production
                                                                          * Linden, 2006 5
                                                                                     Slide
The Topic Today: J2EE
The Topic Today: J2EE

or in other words

Joose -
JavaScript Meta Object System
„Malte Ubl and the Joose folk are
always pushing the boundaries on
munging JavaScript to their whim.“

– Dion Almaer
Slide 9
JavaScript
Slide 9
JavaScript
Slide 10
Embrace & Extend
                   Slide 10
Slide 11
Slide 11
Does everybody hate me now?
Can I have a fresh start?
What is Joose?
What is Joose?


Joose is a meta object system for
JavaScript
What is Joose?


Joose is a meta object system for
JavaScript


Why meta?
Strange Loops are fun!
Does the meta class have a meta
class?
Does the meta class have a meta
class? And the meta class of the
meta class of the meta class.
Does the meta class have a meta
class? And the meta class of the
meta class of the meta class.


Joose is written in itself. Who
wrote „itself“?
JavaScript Object Literals FTW!

Loop unrolling for objects
Developing Joose is fun.
Developing with Joose is fun, too.
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript   Joose/JS


Classes


Prototypes


Packages


Mixins


Traits


Method
Modifiers

Type
Coercions




                                                               Slide 24
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win    Win         Win    Yes You Can   Win


Prototypes


Packages


Mixins


Traits


Method
Modifiers

Type
Coercions




                                                                Slide 25
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win    Win         Win    Yes You Can   Win


Prototypes   Fail   Fail        Fail   Win           Win


Packages


Mixins


Traits


Method
Modifiers

Type
Coercions




                                                                Slide 26
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win    Win         Win    Yes You Can   Win


Prototypes   Fail   Fail        Fail   Win           Win


Packages     Win    Fail/Win    Win    Yes You Can   Win


Mixins


Traits


Method
Modifiers

Type
Coercions




                                                                Slide 27
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win    Win         Win    Yes You Can   Win


Prototypes   Fail   Fail        Fail   Win           Win


Packages     Win    Fail/Win    Win    Yes You Can   Win


Mixins       Fail   Fail        Win    Yes You Can   Win


Traits


Method
Modifiers

Type
Coercions




                                                                Slide 28
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win    Win         Win    Yes You Can   Win


Prototypes   Fail   Fail        Fail   Win           Win


Packages     Win    Fail/Win    Win    Yes You Can   Win


Mixins       Fail   Fail        Win    Yes You Can   Win


Traits       Fail   Win         Fail   Yes You Can   Win


Method
Modifiers

Type
Coercions




                                                                Slide 29
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win    Win         Win    Yes You Can   Win


Prototypes   Fail   Fail        Fail   Win           Win


Packages     Win    Fail/Win    Win    Yes You Can   Win


Mixins       Fail   Fail        Win    Yes You Can   Win


Traits       Fail   Win         Fail   Yes You Can   Win


Method       Fail   Fail        Fail   Yes You Can   Win
Modifiers

Type
Coercions




                                                                Slide 30
Scientific Model of Object System
Awesomeness
             Java   Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win    Win         Win    Yes You Can   Win


Prototypes   Fail   Fail        Fail   Win           Win


Packages     Win    Fail/Win    Win    Yes You Can   Win


Mixins       Fail   Fail        Win    Yes You Can   Win


Traits       Fail   Win         Fail   Yes You Can   Win


Method       Fail   Fail        Fail   Yes You Can   Win
Modifiers

Type         Fail   Fail        Fail   Yes You Can   Win
Coercions




                                                                Slide 31
Scientific Model of Object System
Awesomeness
             Java        Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win         Win         Win    Yes You Can   Win


Prototypes   Fail        Fail        Fail   Win           Win


Packages     Win         Fail/Win    Win    Yes You Can   Win


Mixins       Fail        Fail        Win    Yes You Can   Win


Traits       Fail        Win         Fail   Yes You Can   Win


Method       Fail        Fail        Fail   Yes You Can   Win
Modifiers

Type         Fail        Fail        Fail   Yes You Can   Win
Coercions

             Epic Fail


                                                                     Slide 32
Scientific Model of Object System
Awesomeness
             Java        Smalltalk   Ruby   JavaScript    Joose/JS


Classes      Win         Win         Win    Yes You Can   Win


Prototypes   Fail        Fail        Fail   Win           Win


Packages     Win         Fail/Win    Win    Yes You Can   Win


Mixins       Fail        Fail        Win    Yes You Can   Win


Traits       Fail        Win         Fail   Yes You Can   Win


Method       Fail        Fail        Fail   Yes You Can   Win
Modifiers

Type         Fail        Fail        Fail   Yes You Can   Win
Coercions

             Epic Fail   Failed


                                                                     Slide 33
Scientific Model of Object System
Awesomeness
             Java        Smalltalk   Ruby          JavaScript    Joose/JS


Classes      Win         Win         Win           Yes You Can   Win


Prototypes   Fail        Fail        Fail          Win           Win


Packages     Win         Fail/Win    Win           Yes You Can   Win


Mixins       Fail        Fail        Win           Yes You Can   Win


Traits       Fail        Win         Fail          Yes You Can   Win


Method       Fail        Fail        Fail          Yes You Can   Win
Modifiers

Type         Fail        Fail        Fail          Yes You Can   Win
Coercions

             Epic Fail   Failed      Medium Fail


                                                                            Slide 34
Scientific Model of Object System
Awesomeness
             Java        Smalltalk   Ruby          JavaScript    Joose/JS


Classes      Win         Win         Win           Yes You Can   Win


Prototypes   Fail        Fail        Fail          Win           Win


Packages     Win         Fail/Win    Win           Yes You Can   Win


Mixins       Fail        Fail        Win           Yes You Can   Win


Traits       Fail        Win         Fail          Yes You Can   Win


Method       Fail        Fail        Fail          Yes You Can   Win
Modifiers

Type         Fail        Fail        Fail          Yes You Can   Win
Coercions

             Epic Fail   Failed      Medium Fail   Guru Wins


                                                                            Slide 35
Scientific Model of Object System
Awesomeness
             Java        Smalltalk   Ruby          JavaScript    Joose/JS


Classes      Win         Win         Win           Yes You Can   Win


Prototypes   Fail        Fail        Fail          Win           Win


Packages     Win         Fail/Win    Win           Yes You Can   Win


Mixins       Fail        Fail        Win           Yes You Can   Win


Traits       Fail        Win         Fail          Yes You Can   Win


Method       Fail        Fail        Fail          Yes You Can   Win
Modifiers

Type         Fail        Fail        Fail          Yes You Can   Win
Coercions

             Epic Fail   Failed      Medium Fail   Guru Wins     Win


                                                                            Slide 36
Scientific Model of Object System
 Awesomeness
             Java        Smalltalk   Ruby          JavaScript    Joose/JS   CouchDB


Classes      Win         Win         Win           Yes You Can   Win        Fail


Prototypes   Fail        Fail        Fail          Win           Win        Fail


Packages     Win         Fail/Win    Win           Yes You Can   Win        Fail


Mixins       Fail        Fail        Win           Yes You Can   Win        Fail


Traits       Fail        Win         Fail          Yes You Can   Win        Fail


Method       Fail        Fail        Fail          Yes You Can   Win        Fail
Modifiers

Type         Fail        Fail        Fail          Yes You Can   Win        Fail
Coercions

             Epic Fail   Failed      Medium Fail   Guru Wins     Win        I‘m sorry
                                                                            Jan :)

                                                                                      Slide 37
Scientific Model of Object System
 Awesomeness
             Java        Smalltalk   Ruby          JavaScript    Joose/JS   CouchDB


Classes      Win         Win         Win           Yes You Can   Win        Fail


Prototypes   Fail        Fail        Fail          Win           Win        Fail


Packages     Win         Fail/Win    Win           Yes You Can   Win        Fail


Mixins       Fail        Fail        Win           Yes You Can   Win        Fail


Traits       Fail        Win         Fail          Yes You Can   Win        Fail


Method       Fail        Fail        Fail          Yes You Can   Win        Fail
Modifiers

Type         Fail        Fail        Fail          Yes You Can   Win        Fail
Coercions

             Epic Fail   Failed      Medium Fail   Guru Wins     Win        I‘m sorry
                                                                            Jan :)

                                                                                      Slide 37
Joose is all about embracing
JavaScript while giving you a large
hammer for increased expressivity
when you need it.
Einfach hinschreiben!
Class

Class("Point", {
    has: {
        x: {
             is:   "rw",
             init: 0
        },
        y: {
             is:   "rw",
             init: 0
        }
    },
    methods: {
        clear: function () {
             this.setX(0);
             this.setY(0);
        }
    }
})
Class

Class("Point", {               var point = new Point();
    has: {                     point.setX(10)
        x: {                   point.setY(20);
             is:   "rw",       point.clear();
             init: 0
        },
        y: {
             is:   "rw",
             init: 0
        }
    },
    methods: {
        clear: function () {
             this.setX(0);
             this.setY(0);
        }
    }
})
Class

Class("Point", {               var point = new Point();
    has: {                     point.setX(10)
        x: {                   point.setY(20);
             is:   "rw",       point.clear();
             init: 0
        },
        y: {                   Class("Point3D", {
             is:   "rw",           isa: Point,
             init: 0               has: {
        }                              z: {}
    },                             },
    methods: {                     after: {
        clear: function () {           clear: function () {
             this.setX(0);                 this.z = 0;
             this.setY(0);             }
        }                          }
    }                          })
})
Modules

Module("my.test.module", function (m) {
    Class("Test", {
        methods: { world: function () { return "hello" } }
    });
    Class("Test2", {
        methods: { world: function () { return "hello" } }
    })
})

new my.test.module.Test()
Roles (Traits + State)

Role("Comparable", {
    requires: "compare",

     methods: {
         equalTo:     function (other) { return this.compare(other) == 0 },
         greaterThan: function (other) { return this.compare(other) == 1 },
         lessThan:    function (other) { return this.compare(other) == -1 },

         greaterThanOrEqualTo: function (other) {
             return this.greaterThan(other) || this.equalTo(other)
         }
     }
})
Roles (Traits + State)

Role("Comparable", {
    requires: "compare",

     methods: {
         equalTo:     function (other) { return this.compare(other) == 0 },
         greaterThan: function (other) { return this.compare(other) == 1 },
         lessThan:    function (other) { return this.compare(other) == -1 },

         greaterThanOrEqualTo: function (other) {
             return this.greaterThan(other) || this.equalTo(other)
         }
     }
})

Class("Currency", {
    does: Comparable,
    methods: {
        compare: function () {...}
    }
})
Prototypes

Prototype("Proto", {
    methods: {
        one: function () { return 1 }
    }
})
Prototypes

Prototype("Proto", {
    methods: {
        one: function () { return 1 }
    }
})

                               Every instance of a Prototype
                             gets their own meta class instance!
Prototypes

Prototype("Proto", {
    methods: {
        one: function () { return 1 }
    }
})

                               Every instance of a Prototype
                             gets their own meta class instance!



// similar to
var obj = new SomeJooseClass();
obj.detach()
Type Coercions (no more parseInt)

Type('MySmallNumber', {
    uses: Joose.Type.Int,
    where: function (value) {
        if ( value > 1 && value < 5 ) {
            return true;
        }
        return false;
    },
    coerce: [{
                from: Joose.Type.Str, // coercion from string to number
                via: function(str) {
                    return new Number(Str); // perform our coercion
                }
            }]
});
Type Coercions (no more parseInt)

Class('MyClass', {
    has: {
        myField: {
            is: 'rw',
            isa: Joose.Type.MySmallNumber,
            coerce: true
        }
    }
})

var o = new MyClass();
o.setMyField('3')
alert(o.myField * 2)
Wake Up!
Meta Classes

Class("ControllerMetaClass", {
    isa: Joose.Class,

     methods: {
         handlePropevents: function (map) {
             var self = this;
             var className = this.className();
             Joose.O.eachSafe(map, function (func, topic) {
                 func.displayName = "EventHandler$"+className+"$"+topic;
                 $(document).bind(topic, function () {
                     var obj = self.c.getInstance()
                     func.apply(obj, arguments)
                 })
             })
         }
     }
})
Meta Classes

Class("ProductController", {
    meta: ControllerMetaClass,

     events: {
         "productDetail:selectedColor": function (data) {
             ...
         },

         "productDetail:selectedArticle": function (data) {
             ...
         },

         "productDetail:selectedSizeNotAvailable": function (data) {
             ...
         }
     }
})
Meta Classes
Meta Classes
Meta Classes
Meta Classes

Class("ControllerMetaClass", {
    isa: Joose.Class,

     properties: {
         events: function (map) {
             var self = this;
             var className = this.className();
             Joose.O.eachSafe(map, function (func, topic) {
                 func.displayName = "EventHandler$"+className+"$"+topic;
                 $(document).bind(topic, function () {
                     var obj = self.c.getInstance()
                     func.apply(obj, arguments)
                 })
             })
         }
     }
})
Does it come with overhead?
Yes, using Joose will slow your
application down!
Yes, using Joose will slow your
application down!

But less than a single instance of
$(".className")
Speaking of the DOM


Joose is tested to work well with
jQuery, Prototype (with some
limitations), Dojo and YUI.
And it loves the server as well.


Works with Rhino, V8,
SpiderMonkey and, yes, even
JScript.NET
And it loves the server as well.


Works with Rhino, V8,
SpiderMonkey and, yes, even
JScript.NET
Remember
Strange Loops are fun!
Remember
 Strange Loops are fun!




Joose has Strange Loops
 + increased expressivity
Strange Expressivity!
http://code.google.com/p/joose-
js/

irc://irc.freenode.org/joose

http://github.com/Joose/Joose
Thank You for Listening!


http://nonblocking.io

@cramforce

More Related Content

Similar to J2EE :) Joose - A Meta Object System for JavaScript

Java 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the GalleryJava 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the Gallerynjbartlett
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015AboutYouGmbH
 
There Is No JavaScript
There Is No JavaScriptThere Is No JavaScript
There Is No JavaScriptNoam Kfir
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MMarkus Eisele
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patternsAlassane Diallo
 
Your java script library
Your java script libraryYour java script library
Your java script libraryjasfog
 
Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015
Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015
Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015AboutYouGmbH
 
Devoxx%202008%20Tutorial
Devoxx%202008%20TutorialDevoxx%202008%20Tutorial
Devoxx%202008%20Tutorialtutorialsruby
 
Devoxx%202008%20Tutorial
Devoxx%202008%20TutorialDevoxx%202008%20Tutorial
Devoxx%202008%20Tutorialtutorialsruby
 
Java Presentation
Java PresentationJava Presentation
Java PresentationAmr Salah
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of javaCIB Egypt
 
Java: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedJava: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedSteve Dalton
 
Writing Your Own JSR-Compliant, Domain-Specific Scripting Language
Writing Your Own JSR-Compliant, Domain-Specific Scripting LanguageWriting Your Own JSR-Compliant, Domain-Specific Scripting Language
Writing Your Own JSR-Compliant, Domain-Specific Scripting Languageelliando dias
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBrian Sam-Bodden
 
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...Docker, Inc.
 
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...Alberto Salazar
 
Database Refactoring
Database RefactoringDatabase Refactoring
Database RefactoringAnton Keks
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessMarkus Eisele
 
November 2009 - Whats Cooking At JBoss Tools
November 2009 - Whats Cooking At JBoss ToolsNovember 2009 - Whats Cooking At JBoss Tools
November 2009 - Whats Cooking At JBoss ToolsJBug Italy
 

Similar to J2EE :) Joose - A Meta Object System for JavaScript (20)

Java 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the GalleryJava 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the Gallery
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015
 
There Is No JavaScript
There Is No JavaScriptThere Is No JavaScript
There Is No JavaScript
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patterns
 
Your java script library
Your java script libraryYour java script library
Your java script library
 
Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015
Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015
Jesper Richter-Reichhelm - Continuous Evolution at Wooga - code.talks 2015
 
Devoxx%202008%20Tutorial
Devoxx%202008%20TutorialDevoxx%202008%20Tutorial
Devoxx%202008%20Tutorial
 
Devoxx%202008%20Tutorial
Devoxx%202008%20TutorialDevoxx%202008%20Tutorial
Devoxx%202008%20Tutorial
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
 
Java: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedJava: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggerated
 
Writing Your Own JSR-Compliant, Domain-Specific Scripting Language
Writing Your Own JSR-Compliant, Domain-Specific Scripting LanguageWriting Your Own JSR-Compliant, Domain-Specific Scripting Language
Writing Your Own JSR-Compliant, Domain-Specific Scripting Language
 
The Java alternative to Javascript
The Java alternative to JavascriptThe Java alternative to Javascript
The Java alternative to Javascript
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
 
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
 
Database Refactoring
Database RefactoringDatabase Refactoring
Database Refactoring
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and Serverless
 
November 2009 - Whats Cooking At JBoss Tools
November 2009 - Whats Cooking At JBoss ToolsNovember 2009 - Whats Cooking At JBoss Tools
November 2009 - Whats Cooking At JBoss Tools
 

Recently uploaded

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

J2EE :) Joose - A Meta Object System for JavaScript

  • 2. Me _ Working at SinnerSchrader _ Joose - JavaScript Meta Object System _ http://nonblocking.io Slide 2
  • 3. Me _ Working at SinnerSchrader _ Joose - JavaScript Meta Object System _ http://nonblocking.io @cramforce Slide 2
  • 4. My employer asked me to say a few kind words about SinnerSchrader, so that you all want to work there.
  • 6. SinnerSchrader: The Important Facts * Linden, 2006 5 Slide
  • 7. SinnerSchrader: The Important Facts 1 Server side JS project in production * Linden, 2006 5 Slide
  • 8. SinnerSchrader: The Important Facts 2 Active CouchDB projects 1 Server side JS project in production * Linden, 2006 5 Slide
  • 9. SinnerSchrader: The Important Facts 1 Server side JS project in development 2 Active CouchDB projects 1 Server side JS project in production * Linden, 2006 5 Slide
  • 10. SinnerSchrader: The Important Facts 1 Server side JS project in development 2 1 Erlang projects in planning 2 Active CouchDB projects Server side JS project in production * Linden, 2006 5 Slide
  • 11. SinnerSchrader: The Important Facts 1 10 Mil $ Server side JS project in development in the bank 2 1 Erlang projects in planning 2 Active CouchDB projects Server side JS project in production * Linden, 2006 5 Slide
  • 13. The Topic Today: J2EE or in other words Joose - JavaScript Meta Object System
  • 14. „Malte Ubl and the Joose folk are always pushing the boundaries on munging JavaScript to their whim.“ – Dion Almaer
  • 18. Embrace & Extend Slide 10
  • 22. Can I have a fresh start?
  • 24. What is Joose? Joose is a meta object system for JavaScript
  • 25. What is Joose? Joose is a meta object system for JavaScript Why meta?
  • 26.
  • 28. Does the meta class have a meta class?
  • 29. Does the meta class have a meta class? And the meta class of the meta class of the meta class.
  • 30. Does the meta class have a meta class? And the meta class of the meta class of the meta class. Joose is written in itself. Who wrote „itself“?
  • 31. JavaScript Object Literals FTW! Loop unrolling for objects
  • 33. Developing with Joose is fun, too.
  • 34. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Prototypes Packages Mixins Traits Method Modifiers Type Coercions Slide 24
  • 35. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Packages Mixins Traits Method Modifiers Type Coercions Slide 25
  • 36. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Mixins Traits Method Modifiers Type Coercions Slide 26
  • 37. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Traits Method Modifiers Type Coercions Slide 27
  • 38. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Method Modifiers Type Coercions Slide 28
  • 39. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Modifiers Type Coercions Slide 29
  • 40. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Fail Fail Fail Yes You Can Win Modifiers Type Coercions Slide 30
  • 41. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Fail Fail Fail Yes You Can Win Modifiers Type Fail Fail Fail Yes You Can Win Coercions Slide 31
  • 42. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Fail Fail Fail Yes You Can Win Modifiers Type Fail Fail Fail Yes You Can Win Coercions Epic Fail Slide 32
  • 43. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Fail Fail Fail Yes You Can Win Modifiers Type Fail Fail Fail Yes You Can Win Coercions Epic Fail Failed Slide 33
  • 44. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Fail Fail Fail Yes You Can Win Modifiers Type Fail Fail Fail Yes You Can Win Coercions Epic Fail Failed Medium Fail Slide 34
  • 45. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Fail Fail Fail Yes You Can Win Modifiers Type Fail Fail Fail Yes You Can Win Coercions Epic Fail Failed Medium Fail Guru Wins Slide 35
  • 46. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS Classes Win Win Win Yes You Can Win Prototypes Fail Fail Fail Win Win Packages Win Fail/Win Win Yes You Can Win Mixins Fail Fail Win Yes You Can Win Traits Fail Win Fail Yes You Can Win Method Fail Fail Fail Yes You Can Win Modifiers Type Fail Fail Fail Yes You Can Win Coercions Epic Fail Failed Medium Fail Guru Wins Win Slide 36
  • 47. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS CouchDB Classes Win Win Win Yes You Can Win Fail Prototypes Fail Fail Fail Win Win Fail Packages Win Fail/Win Win Yes You Can Win Fail Mixins Fail Fail Win Yes You Can Win Fail Traits Fail Win Fail Yes You Can Win Fail Method Fail Fail Fail Yes You Can Win Fail Modifiers Type Fail Fail Fail Yes You Can Win Fail Coercions Epic Fail Failed Medium Fail Guru Wins Win I‘m sorry Jan :) Slide 37
  • 48. Scientific Model of Object System Awesomeness Java Smalltalk Ruby JavaScript Joose/JS CouchDB Classes Win Win Win Yes You Can Win Fail Prototypes Fail Fail Fail Win Win Fail Packages Win Fail/Win Win Yes You Can Win Fail Mixins Fail Fail Win Yes You Can Win Fail Traits Fail Win Fail Yes You Can Win Fail Method Fail Fail Fail Yes You Can Win Fail Modifiers Type Fail Fail Fail Yes You Can Win Fail Coercions Epic Fail Failed Medium Fail Guru Wins Win I‘m sorry Jan :) Slide 37
  • 49. Joose is all about embracing JavaScript while giving you a large hammer for increased expressivity when you need it.
  • 51. Class Class("Point", { has: { x: { is: "rw", init: 0 }, y: { is: "rw", init: 0 } }, methods: { clear: function () { this.setX(0); this.setY(0); } } })
  • 52. Class Class("Point", { var point = new Point(); has: { point.setX(10) x: { point.setY(20); is: "rw", point.clear(); init: 0 }, y: { is: "rw", init: 0 } }, methods: { clear: function () { this.setX(0); this.setY(0); } } })
  • 53. Class Class("Point", { var point = new Point(); has: { point.setX(10) x: { point.setY(20); is: "rw", point.clear(); init: 0 }, y: { Class("Point3D", { is: "rw", isa: Point, init: 0 has: { } z: {} }, }, methods: { after: { clear: function () { clear: function () { this.setX(0); this.z = 0; this.setY(0); } } } } }) })
  • 54. Modules Module("my.test.module", function (m) { Class("Test", { methods: { world: function () { return "hello" } } }); Class("Test2", { methods: { world: function () { return "hello" } } }) }) new my.test.module.Test()
  • 55. Roles (Traits + State) Role("Comparable", { requires: "compare", methods: { equalTo: function (other) { return this.compare(other) == 0 }, greaterThan: function (other) { return this.compare(other) == 1 }, lessThan: function (other) { return this.compare(other) == -1 }, greaterThanOrEqualTo: function (other) { return this.greaterThan(other) || this.equalTo(other) } } })
  • 56. Roles (Traits + State) Role("Comparable", { requires: "compare", methods: { equalTo: function (other) { return this.compare(other) == 0 }, greaterThan: function (other) { return this.compare(other) == 1 }, lessThan: function (other) { return this.compare(other) == -1 }, greaterThanOrEqualTo: function (other) { return this.greaterThan(other) || this.equalTo(other) } } }) Class("Currency", { does: Comparable, methods: { compare: function () {...} } })
  • 57. Prototypes Prototype("Proto", { methods: { one: function () { return 1 } } })
  • 58. Prototypes Prototype("Proto", { methods: { one: function () { return 1 } } }) Every instance of a Prototype gets their own meta class instance!
  • 59. Prototypes Prototype("Proto", { methods: { one: function () { return 1 } } }) Every instance of a Prototype gets their own meta class instance! // similar to var obj = new SomeJooseClass(); obj.detach()
  • 60. Type Coercions (no more parseInt) Type('MySmallNumber', { uses: Joose.Type.Int, where: function (value) { if ( value > 1 && value < 5 ) { return true; } return false; }, coerce: [{ from: Joose.Type.Str, // coercion from string to number via: function(str) { return new Number(Str); // perform our coercion } }] });
  • 61. Type Coercions (no more parseInt) Class('MyClass', { has: { myField: { is: 'rw', isa: Joose.Type.MySmallNumber, coerce: true } } }) var o = new MyClass(); o.setMyField('3') alert(o.myField * 2)
  • 63. Meta Classes Class("ControllerMetaClass", { isa: Joose.Class, methods: { handlePropevents: function (map) { var self = this; var className = this.className(); Joose.O.eachSafe(map, function (func, topic) { func.displayName = "EventHandler$"+className+"$"+topic; $(document).bind(topic, function () { var obj = self.c.getInstance() func.apply(obj, arguments) }) }) } } })
  • 64. Meta Classes Class("ProductController", { meta: ControllerMetaClass, events: { "productDetail:selectedColor": function (data) { ... }, "productDetail:selectedArticle": function (data) { ... }, "productDetail:selectedSizeNotAvailable": function (data) { ... } } })
  • 68. Meta Classes Class("ControllerMetaClass", { isa: Joose.Class, properties: { events: function (map) { var self = this; var className = this.className(); Joose.O.eachSafe(map, function (func, topic) { func.displayName = "EventHandler$"+className+"$"+topic; $(document).bind(topic, function () { var obj = self.c.getInstance() func.apply(obj, arguments) }) }) } } })
  • 69. Does it come with overhead?
  • 70. Yes, using Joose will slow your application down!
  • 71. Yes, using Joose will slow your application down! But less than a single instance of $(".className")
  • 72. Speaking of the DOM Joose is tested to work well with jQuery, Prototype (with some limitations), Dojo and YUI.
  • 73. And it loves the server as well. Works with Rhino, V8, SpiderMonkey and, yes, even JScript.NET
  • 74. And it loves the server as well. Works with Rhino, V8, SpiderMonkey and, yes, even JScript.NET
  • 75.
  • 77. Remember Strange Loops are fun! Joose has Strange Loops + increased expressivity
  • 80. Thank You for Listening! http://nonblocking.io @cramforce

Editor's Notes

  1. So why J2EE then? Lets see what some people say about Joose
  2. We&amp;#x2018;re pushing the nice core language away and substitute it with something less pure
  3. The Microsoft Tactic
  4. So if you use Joose, you might as well use J2EE
  5. Who here read G&amp;#xF6;del, Escher, Bach by Douglas Hofstadter? Go home and read it now! I&amp;#x2018;m actually not done yet :) There are all kinds of Strange Loops in Joose