SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
“THE COST OF LEARNING”
advantage of mixer2.org
@nabedge
DBFlute Fes at Shibuya, Tokyo
2015-11-21
http://connpass.com/event/21885/
Who?
● Yu Watanabe
● Java Engineer
● Bizreach.inc
● Project Mixer2
http://mixer2.org
2
What is mixer2 ?
3
Template = 100% pure HTML & CSS
View = Plain Java
Hello <span id=”name”>foo bar</span>
Span span = html.getById(“name”, Span.class);
span.replaceInner(“World !”);
// You get
// Hello <span id=”name”>World !</span>
The cost of learning
4
5
Productivity
▷ Type safe
▷ Automatic
code
generation
▷ Testability
▷ Convention
over
Configuration
▷ Framework
▷ The cost of learning
Learning Curve
6
How to reduce
cost to learn ?
7
8
★ No learn
★ Use that you
already know
9
What do you know ?
▷ Java
▷ HTML/CSS
▷ Eclipse or IntelliJ
▷ JSP + Custum tag
▷ VTL (Velocity Template Language)
▷ FTL (Freemarker Template
Language)
▷ Thymeleaf property + OGNL
Thymeleaf attributes
and utility objects
#ctx
#vars
#locale
#dates
#calendars
#numbers
#strings
#bools
#arrays
#lists
10
#sets
#maps
#aggregates
#messages
#ids
…
…
…
th:if
th:unless
th:text
th:class
th:attr
th:include
th:replace
th:each
th:switch
th:remove
customization
11
1.1. Scenario 1: adding features to the Standard dialects
Say your application uses the SpringStandard dialect and that it needs to show an alert text
box in blue or red background depending on the user’s role (admin or non-admin) from
Monday to Saturday, but always in green on Sundays. You can compute this with conditional
expressions on your template, but too many conditions could render your code a little bit hard
to read…
Solution: create a new attribute called alertclass and an attribute processor for it (Java code
that will compute the right CSS class), and package it into your own MyOwnDialect dialect.
Add this dialect to your template engine with the th prefix (same as the SpringStandardone)
and you’ll now be able to use th:alertclass="${user.role}"!
http://www.thymeleaf.org/doc/tutorials/2.1/extendingthymeleaf.html
Scinario1
12
admin non-admin
Monday to
Saturday
blue red
Sunday green green
<input type=”text” class=”COLOR” />
solution with thymeleaf
13
<input type=”text” th:alterclass=”${user.role}”
public interface IDialect {
public String getPrefix();
public Set<IProcessor> getProcessors();
public Map<String,Object> getExecutionAttributes();
public Set<IDocTypeTranslation> getDocTypeTranslations();
public Set<IDocTypeResolutionEntry> getDocTypeResolutionEntries();
}
lastaflute-mixer2 view class
14
1 public class SigninView extends OrleansBaseView {
2 private final ColorService colorService;
3 ...
4 protected void render(Html html, Mixer2Supporter supporter) {
5 Body body = html.getBody();
6 supporter
7 .findById(body, "account", Input.class)
8 .alwaysPresent(input -> {
9 input.setValue(form.account);
10 input.addCssClass(colorService.choice());
11 });
https://github.com/lastaflute/lastaflute-example-maihama/blob/master/maihama-
orleans/src/main/java/org/docksidestage/app/web/signin/SigninView.java
15
To use Mixer2, You need
▷ Java
▷ HTML/CSS
▷ Eclipse or IntelliJ
▷ JSP + Custum tag
▷ VTL (Velocity Template Language)
▷ FTL (Freemarker Template
Language)
▷ Thymeleaf property + OGNL
What is your GOAL ?
16
A. Learn technology
B. Write code
C. Launch product
““Done is better
than perfect .”
17
Done with ease
by Mixer2
18
Thanks !
19

Weitere ähnliche Inhalte

Was ist angesagt?

Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
elliando dias
 
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik
 
Apache zeppelin, the missing component for the big data ecosystem
Apache zeppelin, the missing component for the big data ecosystemApache zeppelin, the missing component for the big data ecosystem
Apache zeppelin, the missing component for the big data ecosystem
Duyhai Doan
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
Joseph Scott
 

Was ist angesagt? (20)

htaccess
htaccesshtaccess
htaccess
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
 
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten ZiegelerMonitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
 
harry presentation
harry presentationharry presentation
harry presentation
 
Terraform, Ansible or pure CloudFormation
Terraform, Ansible or pure CloudFormationTerraform, Ansible or pure CloudFormation
Terraform, Ansible or pure CloudFormation
 
Terraform, Ansible, or pure CloudFormation?
Terraform, Ansible, or pure CloudFormation?Terraform, Ansible, or pure CloudFormation?
Terraform, Ansible, or pure CloudFormation?
 
Nashorn: nova engine Javascript do Java SE 8
Nashorn: nova engine Javascript do Java SE 8Nashorn: nova engine Javascript do Java SE 8
Nashorn: nova engine Javascript do Java SE 8
 
Vancouver presentation
Vancouver presentationVancouver presentation
Vancouver presentation
 
SWORD & ResourceSync - Stuart Lewis
SWORD & ResourceSync - Stuart Lewis SWORD & ResourceSync - Stuart Lewis
SWORD & ResourceSync - Stuart Lewis
 
Sharding with spider solutions 20160721
Sharding with spider solutions 20160721Sharding with spider solutions 20160721
Sharding with spider solutions 20160721
 
Kharkiv drupal tech talks #2
Kharkiv drupal tech talks #2Kharkiv drupal tech talks #2
Kharkiv drupal tech talks #2
 
HDP Search Overview (APACHE SOLR & HADOOP)
HDP Search Overview (APACHE SOLR & HADOOP)HDP Search Overview (APACHE SOLR & HADOOP)
HDP Search Overview (APACHE SOLR & HADOOP)
 
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
 
Deep Dive Spider Engine
Deep Dive Spider EngineDeep Dive Spider Engine
Deep Dive Spider Engine
 
Apache zeppelin, the missing component for the big data ecosystem
Apache zeppelin, the missing component for the big data ecosystemApache zeppelin, the missing component for the big data ecosystem
Apache zeppelin, the missing component for the big data ecosystem
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
REST in pieces
REST in piecesREST in pieces
REST in pieces
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
 
MySQL Guide for Beginners
MySQL Guide for BeginnersMySQL Guide for Beginners
MySQL Guide for Beginners
 

Andere mochten auch

201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園
201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園
201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園
Y Watanabe
 
2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT
2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT
2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT
Y Watanabe
 
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsugSpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
Y Watanabe
 
Seleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトーク
Seleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトークSeleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトーク
Seleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトーク
Y Watanabe
 
20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java
20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java
20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java
Y Watanabe
 

Andere mochten auch (18)

20130511 jjug ccc講演 さらばjsp JAXBとmixer2
20130511 jjug ccc講演 さらばjsp JAXBとmixer220130511 jjug ccc講演 さらばjsp JAXBとmixer2
20130511 jjug ccc講演 さらばjsp JAXBとmixer2
 
Mixer2によるdynamic css sprite 201309第三回渋谷java
Mixer2によるdynamic css sprite 201309第三回渋谷javaMixer2によるdynamic css sprite 201309第三回渋谷java
Mixer2によるdynamic css sprite 201309第三回渋谷java
 
Mixer2 で作るカスタムテンプレートエンジン #渋谷java
Mixer2 で作るカスタムテンプレートエンジン #渋谷javaMixer2 で作るカスタムテンプレートエンジン #渋谷java
Mixer2 で作るカスタムテンプレートエンジン #渋谷java
 
201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園
201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園
201311 webデザイナとエンジニアのチームワークを加速させるテンプレートエンジンmixer2 devlove現場甲子園
 
2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT
2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT
2013-09 テンプレートエンジンMixer2紹介 HTML5J&JJUG合同勉強会LT
 
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsugSpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
 
日本語によるJUnitの拡張について
日本語によるJUnitの拡張について日本語によるJUnitの拡張について
日本語によるJUnitの拡張について
 
俺のコードがどこでつかわれているのかわからない問題 あるいはマイナーOSSの生存戦略
俺のコードがどこでつかわれているのかわからない問題 あるいはマイナーOSSの生存戦略俺のコードがどこでつかわれているのかわからない問題 あるいはマイナーOSSの生存戦略
俺のコードがどこでつかわれているのかわからない問題 あるいはマイナーOSSの生存戦略
 
jooqってなんて読むの? から始めるO/RマッパーとSpringBootの世界
jooqってなんて読むの? から始めるO/RマッパーとSpringBootの世界jooqってなんて読むの? から始めるO/RマッパーとSpringBootの世界
jooqってなんて読むの? から始めるO/RマッパーとSpringBootの世界
 
渋谷java−あなたのプロジェクトで気軽にjavaをバージョンアップするために必要なこと
渋谷java−あなたのプロジェクトで気軽にjavaをバージョンアップするために必要なこと渋谷java−あなたのプロジェクトで気軽にjavaをバージョンアップするために必要なこと
渋谷java−あなたのプロジェクトで気軽にjavaをバージョンアップするために必要なこと
 
Java Puzzlers JJUG CCC 2016
Java Puzzlers JJUG CCC 2016Java Puzzlers JJUG CCC 2016
Java Puzzlers JJUG CCC 2016
 
テンプレートエンジンにMixer2を使うとSeleniumでのテストもラクになるかもねという話
テンプレートエンジンにMixer2を使うとSeleniumでのテストもラクになるかもねという話テンプレートエンジンにMixer2を使うとSeleniumでのテストもラクになるかもねという話
テンプレートエンジンにMixer2を使うとSeleniumでのテストもラクになるかもねという話
 
properties, yaml, and me
properties, yaml, and meproperties, yaml, and me
properties, yaml, and me
 
Javaでやってみる The Twelve Factor App JJUG-CCC 2014 Fall 講演資料
Javaでやってみる The Twelve Factor App JJUG-CCC 2014 Fall 講演資料Javaでやってみる The Twelve Factor App JJUG-CCC 2014 Fall 講演資料
Javaでやってみる The Twelve Factor App JJUG-CCC 2014 Fall 講演資料
 
テストゼロからイチに進むための戦略と戦術
テストゼロからイチに進むための戦略と戦術テストゼロからイチに進むための戦略と戦術
テストゼロからイチに進むための戦略と戦術
 
Seleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトーク
Seleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトークSeleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトーク
Seleniumと相性がいいテンプレートエンジンMixer2-第1回selenium勉強会ライトニングトーク
 
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
 
20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java
20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java
20140405 mavenセントラルリポジトリへの登録のコツ 第5回渋谷java
 

Ähnlich wie The cost of learning - advantage of mixer2

Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
frwebhelp
 
Jquery Plugin
Jquery PluginJquery Plugin
Jquery Plugin
Ravi Mone
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
Ankur Dongre
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
Ankur Dongre
 

Ähnlich wie The cost of learning - advantage of mixer2 (20)

Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 
Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
Jquery Plugin
Jquery PluginJquery Plugin
Jquery Plugin
 
PHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better CodePHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better Code
 
Osiąganie mądrej architektury z Symfony2
Osiąganie mądrej architektury z Symfony2 Osiąganie mądrej architektury z Symfony2
Osiąganie mądrej architektury z Symfony2
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
 

Mehr von Y Watanabe

Mehr von Y Watanabe (6)

クラウド時代だからSpring-Retryフレームワーク
クラウド時代だからSpring-Retryフレームワーククラウド時代だからSpring-Retryフレームワーク
クラウド時代だからSpring-Retryフレームワーク
 
ツール比較しながら語る O/RマッパーとDBマイグレーションの実際のところ
ツール比較しながら語る O/RマッパーとDBマイグレーションの実際のところツール比較しながら語る O/RマッパーとDBマイグレーションの実際のところ
ツール比較しながら語る O/RマッパーとDBマイグレーションの実際のところ
 
JavaでWebサービスを作り続けるための戦略と戦術 JJUG-CCC-2018-Spring-g1
JavaでWebサービスを作り続けるための戦略と戦術 JJUG-CCC-2018-Spring-g1JavaでWebサービスを作り続けるための戦略と戦術 JJUG-CCC-2018-Spring-g1
JavaでWebサービスを作り続けるための戦略と戦術 JJUG-CCC-2018-Spring-g1
 
サーバーサイドな人がフロントエンド技術と仲良くするはじめの一歩
サーバーサイドな人がフロントエンド技術と仲良くするはじめの一歩サーバーサイドな人がフロントエンド技術と仲良くするはじめの一歩
サーバーサイドな人がフロントエンド技術と仲良くするはじめの一歩
 
Selenium再入門-W3C勧告とページオブジェクトパターンと私-201707webエンジニア勉強会#2神田
Selenium再入門-W3C勧告とページオブジェクトパターンと私-201707webエンジニア勉強会#2神田Selenium再入門-W3C勧告とページオブジェクトパターンと私-201707webエンジニア勉強会#2神田
Selenium再入門-W3C勧告とページオブジェクトパターンと私-201707webエンジニア勉強会#2神田
 
Webエンジニアがスタートダッシュをキメるためのローカル開発環境の勘所
Webエンジニアがスタートダッシュをキメるためのローカル開発環境の勘所Webエンジニアがスタートダッシュをキメるためのローカル開発環境の勘所
Webエンジニアがスタートダッシュをキメるためのローカル開発環境の勘所
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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...
 

The cost of learning - advantage of mixer2

  • 1. “THE COST OF LEARNING” advantage of mixer2.org @nabedge DBFlute Fes at Shibuya, Tokyo 2015-11-21 http://connpass.com/event/21885/
  • 2. Who? ● Yu Watanabe ● Java Engineer ● Bizreach.inc ● Project Mixer2 http://mixer2.org 2
  • 3. What is mixer2 ? 3 Template = 100% pure HTML & CSS View = Plain Java Hello <span id=”name”>foo bar</span> Span span = html.getById(“name”, Span.class); span.replaceInner(“World !”); // You get // Hello <span id=”name”>World !</span>
  • 4. The cost of learning 4
  • 5. 5 Productivity ▷ Type safe ▷ Automatic code generation ▷ Testability ▷ Convention over Configuration ▷ Framework ▷ The cost of learning
  • 7. How to reduce cost to learn ? 7
  • 8. 8 ★ No learn ★ Use that you already know
  • 9. 9 What do you know ? ▷ Java ▷ HTML/CSS ▷ Eclipse or IntelliJ ▷ JSP + Custum tag ▷ VTL (Velocity Template Language) ▷ FTL (Freemarker Template Language) ▷ Thymeleaf property + OGNL
  • 10. Thymeleaf attributes and utility objects #ctx #vars #locale #dates #calendars #numbers #strings #bools #arrays #lists 10 #sets #maps #aggregates #messages #ids … … … th:if th:unless th:text th:class th:attr th:include th:replace th:each th:switch th:remove
  • 11. customization 11 1.1. Scenario 1: adding features to the Standard dialects Say your application uses the SpringStandard dialect and that it needs to show an alert text box in blue or red background depending on the user’s role (admin or non-admin) from Monday to Saturday, but always in green on Sundays. You can compute this with conditional expressions on your template, but too many conditions could render your code a little bit hard to read… Solution: create a new attribute called alertclass and an attribute processor for it (Java code that will compute the right CSS class), and package it into your own MyOwnDialect dialect. Add this dialect to your template engine with the th prefix (same as the SpringStandardone) and you’ll now be able to use th:alertclass="${user.role}"! http://www.thymeleaf.org/doc/tutorials/2.1/extendingthymeleaf.html
  • 12. Scinario1 12 admin non-admin Monday to Saturday blue red Sunday green green <input type=”text” class=”COLOR” />
  • 13. solution with thymeleaf 13 <input type=”text” th:alterclass=”${user.role}” public interface IDialect { public String getPrefix(); public Set<IProcessor> getProcessors(); public Map<String,Object> getExecutionAttributes(); public Set<IDocTypeTranslation> getDocTypeTranslations(); public Set<IDocTypeResolutionEntry> getDocTypeResolutionEntries(); }
  • 14. lastaflute-mixer2 view class 14 1 public class SigninView extends OrleansBaseView { 2 private final ColorService colorService; 3 ... 4 protected void render(Html html, Mixer2Supporter supporter) { 5 Body body = html.getBody(); 6 supporter 7 .findById(body, "account", Input.class) 8 .alwaysPresent(input -> { 9 input.setValue(form.account); 10 input.addCssClass(colorService.choice()); 11 }); https://github.com/lastaflute/lastaflute-example-maihama/blob/master/maihama- orleans/src/main/java/org/docksidestage/app/web/signin/SigninView.java
  • 15. 15 To use Mixer2, You need ▷ Java ▷ HTML/CSS ▷ Eclipse or IntelliJ ▷ JSP + Custum tag ▷ VTL (Velocity Template Language) ▷ FTL (Freemarker Template Language) ▷ Thymeleaf property + OGNL
  • 16. What is your GOAL ? 16 A. Learn technology B. Write code C. Launch product
  • 17. ““Done is better than perfect .” 17
  • 18. Done with ease by Mixer2 18