SlideShare ist ein Scribd-Unternehmen logo
1 von 77
Downloaden Sie, um offline zu lesen
Mura ORM and EmberJS
• By Matt Levine

Who Am I?
Who Am I?
• CTO of Blue River Interactive Group
Who Am I?
• CTO of Blue River Interactive Group

• Started Mura CMS with Sean Schoeder a long time
ago...
What We’re Talking About
What We’re Talking About
• Mura ORM
What We’re Talking About
• Mura ORM

• EmberJS
What We’re Talking About
• Mura ORM

• EmberJS

• But Mostly Mura ORM
Why Mura ORM?
Why Mura ORM?
• It all started with creating the Mura approval chains.
Why Mura ORM?
• It all started with creating the new Mura approval
chains.

• Needed to create 5 new entities and didn’t want to
write a custom DAO for each one.
Started with 3 Options
Started with 3 Options
• Custom DAOs
Custom DAOs
• Too much work
Custom DAOs
• Too much work

• No code re-use
Started with 3 Options
• Custom DAOs

• Mura Class Extension Module
Mura Class Extension Module
GREAT FOR: 

• Targeting nodes for custom business logic
Mura Class Extension Module
GREAT FOR: 

• Targeting nodes for custom business logic

• Rendering events
Mura Class Extension Module
GREAT FOR: 

• Targeting nodes for custom business logic

• Rendering events

• Data events
Mura Class Extension Module
GREAT FOR: 

• Targeting nodes for custom business logic

• Rendering events

• Data events

• Adding custom values to be used within rendering and
data events
Mura Class Extension Module
NOT AS GOOD FOR: 

• Maintaining relationships between entities
Mura Class Extension Module
NOT AS GOOD FOR: 

• Maintaining relationships between entities

• Really custom business logic
Mura Class Extension Module
NOT AS GOOD FOR: 

• Maintaining relationships between entities

• Really custom business logic

• Directly querying the database
Mura Class Extension Module
RECAP:

• Only handles very simple entities
Mura Class Extension Module
RECAP:

• Only handles very simple entities

• Great for hooking attributes to existing Mura entities, but
bad for complicated logic.
Mura Class Extension Module
RECAP:

• Only handles very simple entities

• Great for hooking attributes to existing Mura entities, but
bad for complicated logic.

• Want the data to be stored in flat tables.
Mura Class Extension Module
RECAP:

• Only handles very simple entities

• Great for hooking attributes to existing Mura entities, but
bad for complicated logic.

• Want the data to be stored in flat tables.

• Not the appropriate choice
Started with 3 Options
• Custom DAOs

• Mura Class Extension Module

• CF based Hibernate ORM
CF Hibernate ORM
GREAT FOR:

•Easily defining entity properties
CF Hibernate ORM
GREAT FOR:

•Easily defining entity properties

•CRUD operations
CF Hibernate ORM
GREAT FOR:

•Easily defining entity properties

•CRUD operations

•Managing relationships to other CF ORM entities
CF Hibernate ORM
GREAT FOR:

•Easily defining entity properties

•CRUD operations

•Managing relationships to other CF ORM entities

•You just describe the entity with properties and start
using it!
CF Hibernate ORM
NOT SO GOOD FOR:

•Creating relationships to Mura core entites
CF Hibernate ORM
NOT SO GOOD FOR:

•Creating relationships to Mura core entites

•Working with DI1
CF Hibernate ORM
NOT SO GOOD FOR:

•Creating relationships to Mura core entites

•Working with DI1

•Don’t want to deal with sharing hibernate sessions with
other application and plugins
CF Hibernate ORM
NOT SO GOOD FOR:

•Creating relationships to Mura core entites

•Working with DI1

•Don’t want to deal with sharing hibernate sessions with
other application and plugins

•It just works, but when it doesn't... Good Luck
CF Hibernate ORM
RECAP:

•Love the concept!
CF Hibernate ORM
RECAP:

•Love the concept!

•Seems like CF ORM would be a walled garden.
CF Hibernate ORM
RECAP:

•Love the concept!

•Seems like CF ORM would be a walled garden.

•Sharing a ORM session with other sub applications
sounds like a nightmare
CF Hibernate ORM
RECAP:

•Love the concept!

•Seems like CF ORM would be a walled garden.

•Sharing a ORM session with other sub applications
sounds like a nightmare

•I would like the relationships to be based on DI1
BeanName or Alias rather than component path.
CF Hibernate ORM
RECAP:

•When things go wrong it really feels like a black box. You
get low level java error that don't neccesarilly easily map
to what you did wrong in your CFML

•CF ORM really seems to want you to forget about sql
and just go through it's black box. I like sql. I think is it's
pretty darn cool
What if?
What if?
• I roll my own that works exactly how Mura works!
I Could Make Them
Accesible via $.getBean(entityName); 
and
application.serviceFactory(entityName);

Takes advantage of DI1 dependency injection
Have the Same Interactions
• entity.loadBy()

• entity.get{relateEntity}Iterator();

• entity.get{relateEntity}Query();

• entity.get{relateEntity}();

• entity.getFeed();

• entity.validate();

• entity.getError();
Have the Same Interactions
• entityFeed.addParam();

• entityFeed.getQuery();

• entityFeed.getIterator();
Have the Same Interactions
feed=$.getBean(entityName).getFeed();

feed.addParam(column=’mycolumn’,criteria=‘test’);

iterator=feed.getIterator();

!
<cfloop condition=”iterator.hasNext()”>

<cfoutput>#iterator.next().getMyColumn()#</cfoutput>

</cfloop>
Be Targetable By Mura Events
component extends=”mura.cfobject”{

onBeforeMyEntitySave($){

var bean=$.event(‘bean’);

....

}

}
They Could Also
• Know how to bundle themselves

• Play well with Mura content versioning

• Have a more simple implementation than CF ORM
It could use the same
component attributes
• entityName

• table

• datasource

• discriminatorColumn

• discriminatorValue

• orderby

• readonly
With some new ones
• bundleable

• cacheName

• dbtype

• manageSchema

• useTrash
It could use the same property
attributes
• name

• persistent

• fieldtype

• cfc

• fkcolumn

• type

• cascade

• singularName

• orderby

• length
• default

• ormType

!
!
With some new ones
• dataType

• nullable

• required

• validate

• message

• regex

• comparable
And a bunch attributes for
validation
• minValue

• maxValue

• minLength

• maxLength

• minCollection

• maxCollection

• minList

• maxList

• inList

• method

• lte

• lt

• gte

• gt

• eq

• neq
It could also support CF ORM
• preLoad();

• postLoad();

• preUpdate();

• postUpdate();

• preCreate();
• postCreate();

• postInsert();

• preDelete();

• postDelete();
So that’s what we did
So that’s what we did
• Now let’s actually see some code
EmberJS
EmberJS
• A Framework for Creating 



Ambitious Web Applications
EmberJS
• A Framework for Creating 



Ambitious Web Applications

• A Client Side MVC Framework
EmberJS
• A Framework for Creating 



Ambitious Web Applications

• A Client Side MVC Framework

• That’s opinionated in a good way
EmberJS
• A Framework for Creating 



Ambitious Web Applications

• A Client Side MVC Framework

• That’s opinionated in a good way

• So that your application is developed in a consistent
way which enables easier scalability
EmberJS
• A Framework for Creating 



Ambitious Web Applications

• A Client Side MVC Framework

• That’s opinionated in a good way

• So that your application is developed in a consistent
way which enables easier scalability

• Utilizes Handlebars.js for easy templating
Handlebar.JS
<div>

<label>Name:</label>

{{input type="text" value=name placeholder="Enter your
name"}}

</div>

<div class="text">

<h1>My name is {{name}} and I want to learn Ember!</h1>

</div>
Ember-Data
•A Data Persistence Library for Ember.js
Ember-Data
•A Data Persistence Library for Ember.js

•We’ve created a Mura ORM Adapter for Ember-Data
Ember-Data
•A Data Persistence Library for Ember.js

•We’ve created a Mura ORM Adapter for Ember-Data

•Sooo…
Ember-Data
component extends="mura.bean.beanORM" 

entityName="widget" table="widgets" {

property name="widgetid" fieldtype=“id";

property name="name" type=“string"

length="100"
required=true message="The name attribute is required an
must be.";

property name="options" singularname="option"
fieldtype="one-to-many" cfc="option" cascade="delete"; 

}
Ember-Data
App.Widget = DS.Model.extend({

primaryKey: 'widgetid',

widgetid: DS.attr(),

siteid: DS.attr(),

name: DS.attr(),

options: DS.hasMany('Option',{async:true})

});
Ember-Data
component extends="mura.bean.beanORM"
entityName="option" table="widgetoptions" {

property name="optionid" fieldtype="id";

property name="name" type="string" length="100"
required=true message="The name attribute is required
an must be.";

property name="widget" fieldtype="many-to-one"
cfc="widget" fkcolumn="widgetid";

}
Ember-Data
App.Option = DS.Model.extend({

primaryKey: 'optionid',

optionid: DS.attr(),

siteid: DS.attr(),

name: DS.attr(),

widgetid: DS.attr(),

widget: DS.belongsTo('Widget',{async:true})

});
Ember-Data
App.WidgetRoute = Ember.Route.extend({

model: function(params) {

return this.store.find(‘Widget’,params.widgetid);

}

});
Ember-Data
<script type="text/x-handlebars" id=“widget">

<h3>{{name}} ({{options.length}})</h3>

{{#if options.length}}

<ul>

{{#each option in options}}

	 	 <li>{{option.name}}</li>

{{/each}}

</ul>

{{/if}}

</script>
Ember.js
•We’re currently prototyping an Ember.js based front
for Mura
Ember.js
•We’re currently prototyping an Ember.js based front
for Mura

•It will allow Mura to run as a service
Ember.js
•We’re currently prototyping an Ember.js based front
for Mura

•It will allow Mura to run as a service

•This will allow Mura sites to be served locally on any
web server without needing a servlet container.
Ember.js
•We’re currently prototyping an Ember.js based front
for Mura

•It will allow Mura to run as a service

•This will allow Mura sites to be served locally on any
web server without needing a servlet container.

•We feel at this point it’s a perfect fit

Weitere ähnliche Inhalte

Ähnlich wie Mura ORM & Ember JS

Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and AbstractionsMetosin Oy
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMOrtus Solutions, Corp
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06jimbojsb
 
Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Charles Nutter
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLRichard Schneeman
 
Alfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy BehavioursAlfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy BehavioursJ V
 
Super Fast Application development with Mura CMS
Super Fast Application development with Mura CMSSuper Fast Application development with Mura CMS
Super Fast Application development with Mura CMSColdFusionConference
 
Customising civicrm
Customising civicrmCustomising civicrm
Customising civicrmChris Ward
 
Intelligent Stream Filtering Using MongoDB
Intelligent Stream Filtering Using MongoDBIntelligent Stream Filtering Using MongoDB
Intelligent Stream Filtering Using MongoDBMihnea Giurgea
 
Rapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsRapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsSimobo
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleChristophe Grand
 
Terraform: Infrastructure as Code
Terraform: Infrastructure as CodeTerraform: Infrastructure as Code
Terraform: Infrastructure as CodePradeep Bhadani
 
flickr's architecture & php
flickr's architecture & php flickr's architecture & php
flickr's architecture & php coolpics
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudAnshum Gupta
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsJonas Bonér
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5jakemallory
 

Ähnlich wie Mura ORM & Ember JS (20)

Orm loveandhate
Orm loveandhateOrm loveandhate
Orm loveandhate
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORM
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
 
Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
 
Alfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy BehavioursAlfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy Behaviours
 
Super Fast Application development with Mura CMS
Super Fast Application development with Mura CMSSuper Fast Application development with Mura CMS
Super Fast Application development with Mura CMS
 
ORM Pink Unicorns
ORM Pink UnicornsORM Pink Unicorns
ORM Pink Unicorns
 
Customising civicrm
Customising civicrmCustomising civicrm
Customising civicrm
 
Intelligent Stream Filtering Using MongoDB
Intelligent Stream Filtering Using MongoDBIntelligent Stream Filtering Using MongoDB
Intelligent Stream Filtering Using MongoDB
 
Ember - introduction
Ember - introductionEmber - introduction
Ember - introduction
 
Testing gone-right
Testing gone-rightTesting gone-right
Testing gone-right
 
Rapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsRapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on Rails
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit Hole
 
Terraform: Infrastructure as Code
Terraform: Infrastructure as CodeTerraform: Infrastructure as Code
Terraform: Infrastructure as Code
 
flickr's architecture & php
flickr's architecture & php flickr's architecture & php
flickr's architecture & php
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5
 

Mehr von Mura CMS

Mura CMS 6.1 Overview
Mura CMS 6.1 OverviewMura CMS 6.1 Overview
Mura CMS 6.1 OverviewMura CMS
 
Community its easier than you think
Community its easier than you thinkCommunity its easier than you think
Community its easier than you thinkMura CMS
 
Interacting with the Mura CMS Core
Interacting with the Mura CMS CoreInteracting with the Mura CMS Core
Interacting with the Mura CMS CoreMura CMS
 
Faceted Search In Mura CMS Using Elasticsearch
Faceted Search In Mura CMS Using ElasticsearchFaceted Search In Mura CMS Using Elasticsearch
Faceted Search In Mura CMS Using ElasticsearchMura CMS
 
Mura CMS Publishing Workflow
Mura CMS Publishing WorkflowMura CMS Publishing Workflow
Mura CMS Publishing WorkflowMura CMS
 
How To Plan A Successful Multi-Site Deployment In Mura CMS
How To Plan A Successful Multi-Site Deployment In Mura CMSHow To Plan A Successful Multi-Site Deployment In Mura CMS
How To Plan A Successful Multi-Site Deployment In Mura CMSMura CMS
 
Mura CMS & Moodle LMS
Mura CMS & Moodle LMSMura CMS & Moodle LMS
Mura CMS & Moodle LMSMura CMS
 
Effective Intranet Planning
Effective Intranet PlanningEffective Intranet Planning
Effective Intranet PlanningMura CMS
 
Railo 4.0 - MuraCon Presentations
Railo 4.0 - MuraCon PresentationsRailo 4.0 - MuraCon Presentations
Railo 4.0 - MuraCon PresentationsMura CMS
 
Integrating Google Search Appliance with Mura CMS
Integrating Google Search Appliance with Mura CMSIntegrating Google Search Appliance with Mura CMS
Integrating Google Search Appliance with Mura CMSMura CMS
 

Mehr von Mura CMS (10)

Mura CMS 6.1 Overview
Mura CMS 6.1 OverviewMura CMS 6.1 Overview
Mura CMS 6.1 Overview
 
Community its easier than you think
Community its easier than you thinkCommunity its easier than you think
Community its easier than you think
 
Interacting with the Mura CMS Core
Interacting with the Mura CMS CoreInteracting with the Mura CMS Core
Interacting with the Mura CMS Core
 
Faceted Search In Mura CMS Using Elasticsearch
Faceted Search In Mura CMS Using ElasticsearchFaceted Search In Mura CMS Using Elasticsearch
Faceted Search In Mura CMS Using Elasticsearch
 
Mura CMS Publishing Workflow
Mura CMS Publishing WorkflowMura CMS Publishing Workflow
Mura CMS Publishing Workflow
 
How To Plan A Successful Multi-Site Deployment In Mura CMS
How To Plan A Successful Multi-Site Deployment In Mura CMSHow To Plan A Successful Multi-Site Deployment In Mura CMS
How To Plan A Successful Multi-Site Deployment In Mura CMS
 
Mura CMS & Moodle LMS
Mura CMS & Moodle LMSMura CMS & Moodle LMS
Mura CMS & Moodle LMS
 
Effective Intranet Planning
Effective Intranet PlanningEffective Intranet Planning
Effective Intranet Planning
 
Railo 4.0 - MuraCon Presentations
Railo 4.0 - MuraCon PresentationsRailo 4.0 - MuraCon Presentations
Railo 4.0 - MuraCon Presentations
 
Integrating Google Search Appliance with Mura CMS
Integrating Google Search Appliance with Mura CMSIntegrating Google Search Appliance with Mura CMS
Integrating Google Search Appliance with Mura CMS
 

Kürzlich hochgeladen

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Kürzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Mura ORM & Ember JS

  • 1. Mura ORM and EmberJS • By Matt Levine

  • 3. Who Am I? • CTO of Blue River Interactive Group
  • 4. Who Am I? • CTO of Blue River Interactive Group • Started Mura CMS with Sean Schoeder a long time ago...
  • 6. What We’re Talking About • Mura ORM
  • 7. What We’re Talking About • Mura ORM • EmberJS
  • 8. What We’re Talking About • Mura ORM • EmberJS • But Mostly Mura ORM
  • 10. Why Mura ORM? • It all started with creating the Mura approval chains.
  • 11. Why Mura ORM? • It all started with creating the new Mura approval chains. • Needed to create 5 new entities and didn’t want to write a custom DAO for each one.
  • 12. Started with 3 Options
  • 13. Started with 3 Options • Custom DAOs
  • 14. Custom DAOs • Too much work
  • 15. Custom DAOs • Too much work • No code re-use
  • 16. Started with 3 Options • Custom DAOs • Mura Class Extension Module
  • 17. Mura Class Extension Module GREAT FOR: • Targeting nodes for custom business logic
  • 18. Mura Class Extension Module GREAT FOR: • Targeting nodes for custom business logic • Rendering events
  • 19. Mura Class Extension Module GREAT FOR: • Targeting nodes for custom business logic • Rendering events • Data events
  • 20. Mura Class Extension Module GREAT FOR: • Targeting nodes for custom business logic • Rendering events • Data events • Adding custom values to be used within rendering and data events
  • 21. Mura Class Extension Module NOT AS GOOD FOR: • Maintaining relationships between entities
  • 22. Mura Class Extension Module NOT AS GOOD FOR: • Maintaining relationships between entities • Really custom business logic
  • 23. Mura Class Extension Module NOT AS GOOD FOR: • Maintaining relationships between entities • Really custom business logic • Directly querying the database
  • 24. Mura Class Extension Module RECAP: • Only handles very simple entities
  • 25. Mura Class Extension Module RECAP: • Only handles very simple entities • Great for hooking attributes to existing Mura entities, but bad for complicated logic.
  • 26. Mura Class Extension Module RECAP: • Only handles very simple entities • Great for hooking attributes to existing Mura entities, but bad for complicated logic. • Want the data to be stored in flat tables.
  • 27. Mura Class Extension Module RECAP: • Only handles very simple entities • Great for hooking attributes to existing Mura entities, but bad for complicated logic. • Want the data to be stored in flat tables. • Not the appropriate choice
  • 28. Started with 3 Options • Custom DAOs • Mura Class Extension Module • CF based Hibernate ORM
  • 29. CF Hibernate ORM GREAT FOR: •Easily defining entity properties
  • 30. CF Hibernate ORM GREAT FOR: •Easily defining entity properties •CRUD operations
  • 31. CF Hibernate ORM GREAT FOR: •Easily defining entity properties •CRUD operations •Managing relationships to other CF ORM entities
  • 32. CF Hibernate ORM GREAT FOR: •Easily defining entity properties •CRUD operations •Managing relationships to other CF ORM entities •You just describe the entity with properties and start using it!
  • 33. CF Hibernate ORM NOT SO GOOD FOR: •Creating relationships to Mura core entites
  • 34. CF Hibernate ORM NOT SO GOOD FOR: •Creating relationships to Mura core entites •Working with DI1
  • 35. CF Hibernate ORM NOT SO GOOD FOR: •Creating relationships to Mura core entites •Working with DI1 •Don’t want to deal with sharing hibernate sessions with other application and plugins
  • 36. CF Hibernate ORM NOT SO GOOD FOR: •Creating relationships to Mura core entites •Working with DI1 •Don’t want to deal with sharing hibernate sessions with other application and plugins •It just works, but when it doesn't... Good Luck
  • 38. CF Hibernate ORM RECAP: •Love the concept! •Seems like CF ORM would be a walled garden.
  • 39. CF Hibernate ORM RECAP: •Love the concept! •Seems like CF ORM would be a walled garden. •Sharing a ORM session with other sub applications sounds like a nightmare
  • 40. CF Hibernate ORM RECAP: •Love the concept! •Seems like CF ORM would be a walled garden. •Sharing a ORM session with other sub applications sounds like a nightmare •I would like the relationships to be based on DI1 BeanName or Alias rather than component path.
  • 41. CF Hibernate ORM RECAP: •When things go wrong it really feels like a black box. You get low level java error that don't neccesarilly easily map to what you did wrong in your CFML •CF ORM really seems to want you to forget about sql and just go through it's black box. I like sql. I think is it's pretty darn cool
  • 43. What if? • I roll my own that works exactly how Mura works!
  • 44. I Could Make Them Accesible via $.getBean(entityName); 
and application.serviceFactory(entityName); Takes advantage of DI1 dependency injection
  • 45. Have the Same Interactions • entity.loadBy() • entity.get{relateEntity}Iterator(); • entity.get{relateEntity}Query(); • entity.get{relateEntity}(); • entity.getFeed(); • entity.validate(); • entity.getError();
  • 46. Have the Same Interactions • entityFeed.addParam(); • entityFeed.getQuery(); • entityFeed.getIterator();
  • 47. Have the Same Interactions feed=$.getBean(entityName).getFeed(); feed.addParam(column=’mycolumn’,criteria=‘test’); iterator=feed.getIterator(); ! <cfloop condition=”iterator.hasNext()”> <cfoutput>#iterator.next().getMyColumn()#</cfoutput> </cfloop>
  • 48. Be Targetable By Mura Events component extends=”mura.cfobject”{ onBeforeMyEntitySave($){ var bean=$.event(‘bean’); .... } }
  • 49. They Could Also • Know how to bundle themselves • Play well with Mura content versioning • Have a more simple implementation than CF ORM
  • 50. It could use the same component attributes • entityName • table • datasource • discriminatorColumn • discriminatorValue
 • orderby • readonly
  • 51. With some new ones • bundleable • cacheName • dbtype • manageSchema • useTrash
  • 52. It could use the same property attributes • name • persistent • fieldtype • cfc • fkcolumn
 • type • cascade • singularName • orderby • length • default • ormType ! !
  • 53. With some new ones • dataType • nullable • required • validate • message
 • regex • comparable
  • 54. And a bunch attributes for validation • minValue • maxValue • minLength • maxLength • minCollection
 • maxCollection • minList • maxList • inList • method • lte • lt • gte • gt • eq • neq
  • 55. It could also support CF ORM • preLoad(); • postLoad(); • preUpdate(); • postUpdate(); • preCreate(); • postCreate(); • postInsert(); • preDelete(); • postDelete();
  • 57. So that’s what we did • Now let’s actually see some code
  • 59. EmberJS • A Framework for Creating 



Ambitious Web Applications
  • 60. EmberJS • A Framework for Creating 



Ambitious Web Applications • A Client Side MVC Framework
  • 61. EmberJS • A Framework for Creating 



Ambitious Web Applications • A Client Side MVC Framework • That’s opinionated in a good way
  • 62. EmberJS • A Framework for Creating 



Ambitious Web Applications • A Client Side MVC Framework • That’s opinionated in a good way • So that your application is developed in a consistent way which enables easier scalability
  • 63. EmberJS • A Framework for Creating 



Ambitious Web Applications • A Client Side MVC Framework • That’s opinionated in a good way • So that your application is developed in a consistent way which enables easier scalability • Utilizes Handlebars.js for easy templating
  • 64. Handlebar.JS <div> <label>Name:</label> {{input type="text" value=name placeholder="Enter your name"}} </div> <div class="text"> <h1>My name is {{name}} and I want to learn Ember!</h1> </div>
  • 65. Ember-Data •A Data Persistence Library for Ember.js
  • 66. Ember-Data •A Data Persistence Library for Ember.js •We’ve created a Mura ORM Adapter for Ember-Data
  • 67. Ember-Data •A Data Persistence Library for Ember.js •We’ve created a Mura ORM Adapter for Ember-Data •Sooo…
  • 68. Ember-Data component extends="mura.bean.beanORM" 
 entityName="widget" table="widgets" { property name="widgetid" fieldtype=“id"; property name="name" type=“string"

length="100" required=true message="The name attribute is required an must be.";
 property name="options" singularname="option" fieldtype="one-to-many" cfc="option" cascade="delete"; }
  • 69. Ember-Data App.Widget = DS.Model.extend({ primaryKey: 'widgetid', widgetid: DS.attr(), siteid: DS.attr(), name: DS.attr(), options: DS.hasMany('Option',{async:true}) });
  • 70. Ember-Data component extends="mura.bean.beanORM" entityName="option" table="widgetoptions" { property name="optionid" fieldtype="id"; property name="name" type="string" length="100" required=true message="The name attribute is required an must be."; property name="widget" fieldtype="many-to-one" cfc="widget" fkcolumn="widgetid"; }
  • 71. Ember-Data App.Option = DS.Model.extend({ primaryKey: 'optionid', optionid: DS.attr(), siteid: DS.attr(), name: DS.attr(), widgetid: DS.attr(), widget: DS.belongsTo('Widget',{async:true}) });
  • 72. Ember-Data App.WidgetRoute = Ember.Route.extend({ model: function(params) { return this.store.find(‘Widget’,params.widgetid); } });
  • 73. Ember-Data <script type="text/x-handlebars" id=“widget"> <h3>{{name}} ({{options.length}})</h3> {{#if options.length}} <ul> {{#each option in options}} <li>{{option.name}}</li> {{/each}} </ul> {{/if}} </script>
  • 74. Ember.js •We’re currently prototyping an Ember.js based front for Mura
  • 75. Ember.js •We’re currently prototyping an Ember.js based front for Mura •It will allow Mura to run as a service
  • 76. Ember.js •We’re currently prototyping an Ember.js based front for Mura •It will allow Mura to run as a service •This will allow Mura sites to be served locally on any web server without needing a servlet container.
  • 77. Ember.js •We’re currently prototyping an Ember.js based front for Mura •It will allow Mura to run as a service •This will allow Mura sites to be served locally on any web server without needing a servlet container. •We feel at this point it’s a perfect fit