SlideShare uma empresa Scribd logo
1 de 83
Baixar para ler offline
Asynchronous Single Page Applications
without a Line of HTML or Javascript.
Or why D is just awesome
Robert ”burner” Schadek
May 5, 2016
DConf
Javascript and HTML are awesome
• No explicit types
• Variables may be undefined
• Repetition repetition repetition
• No templates
• No compile time function execution
• No compile time
1
Goals
• Retain type-information of data from DB to Client’s
Browser
3
Goals
• Retain type-information of data from DB to Client’s
Browser
• Keeping things DRY
3
Goals
• Retain type-information of data from DB to Client’s
Browser
• Keeping things DRY
• Performance
3
Goals
• Retain type-information of data from DB to Client’s
Browser
• Keeping things DRY
• Performance
• Get things done
3
Vibe.d and Diet
Vibe.d
• Powerful asynchronous I/O and web toolkit for D
• Uses Fibers and Threads
4
Vibe.d
• Powerful asynchronous I/O and web toolkit for D
• Uses Fibers and Threads
• n → m mapping
• yield()
• async IO
4
Vibe.d
• Powerful asynchronous I/O and web toolkit for D
• Uses Fibers and Threads
• n → m mapping
• yield()
• async IO
• async DB connectivity for MongoDB, Redis, MySQL
• You don’t need to care about async
• Web interface generator
• REST interface generator
4
REST Interface Generator
i n t e r f a c e MyAPI {
// GET /weather −> responds {” text ”: ” . . . ” , ”
→ temperature ”: . . . }
Weather getWeather () ;
}
5
REST Interface Generator
i n t e r f a c e MyAPI {
// GET /weather −> responds {” text ”: ” . . . ” , ”
→ temperature ”: . . . }
Weather getWeather () ;
}
c l a s s MyAPIImplementation : MyAPI {
auto weather = [ ”sunny” , ” rainy ” , ” cats and dogs ”
→ , ”snow” ] ;
Weather getWeather () {
return Weather (
weather [ uniform (0 , weather . length ) ] ,
uniform ( −10 ,30)
) ;
}
} 5
REST Interface Generator
auto router = new URLRouter ;
router . get ( ”/” , staticTemplate ! ” index . dt” ) ;
router . get ( ”/main . html” , staticTemplate ! ”main . dt” ) ;
router . r e g i s t e r R e s t I n t e r f a c e !MyAPI(new
→ MyAPIImplementation , r e s t s e t t i n g s ) ;
6
REST Interface Generator
auto router = new URLRouter ;
router . get ( ”/” , staticTemplate ! ” index . dt” ) ;
router . get ( ”/main . html” , staticTemplate ! ”main . dt” ) ;
router . r e g i s t e r R e s t I n t e r f a c e !MyAPI(new
→ MyAPIImplementation , r e s t s e t t i n g s ) ;
struct Weather {
s t r i n g text ;
double temperature ;
}
6
AngularJS Typescript
i n t e r f a c e Weather {
text : string ,
temperature : number
}
7
AngularJS Typescript
i n t e r f a c e Weather {
text : string ,
temperature : number
}
i n t e r f a c e MainScope extends ng . IScope {
weather : Weather
}
7
AngularJS Typescript
i n t e r f a c e Weather {
text : string ,
temperature : number
}
i n t e r f a c e MainScope extends ng . IScope {
weather : Weather
}
c l a s s MainCtrl {
public s t a t i c $ i n j e c t = [ ’ $scope ’ , ’ $http ’ ] ;
constructor ( private $scope : MainScope ,
private $http : ng . IHttpService )
{
t h i s . weather () ;
}
7
AngularJS Typescript
weather () : void {
var s = ’ /weather ’ ;
t h i s . $http . get ( s ) . success (( data : Weather ) => {
t h i s . $scope . weather = data ;
}) ;
}
8
Diet
doctype html
html (ng−app=”myapp”)
head
t i t l e DConf 2016 Weather
− j a v a s c r i p t ( ” . / angular . j s ”) ;
− j a v a s c r i p t ( ” . / angular−route . j s ”) ;
− j a v a s c r i p t ( ” . / myapp . j s ”) ;
body
div (ng−view )
9
Diet
doctype html
html (ng−app=”myapp”)
head
t i t l e DConf 2016 Weather
− j a v a s c r i p t ( ” . / angular . j s ”) ;
− j a v a s c r i p t ( ” . / angular−route . j s ”) ;
− j a v a s c r i p t ( ” . / myapp . j s ”) ;
body
div (ng−view )
− void j a v a s c r i p t ( s t r i n g name)
s c r i p t ( src=”#{name}”)
9
Diet
. container
p {{ weather . text }}
p {{ weather . temperature }}
button ( type=”submit ” ,ng−c l i c k =” c t r l . weather () ; ” )
→ Get Weather
10
Live Demo
Dataflow from the Server to the
Frontend and back again
Dataflow from the Server to the Frontend and back again
struct Weather {
s t r i n g text ;
double temperature ;
}
Dlang
11
Dataflow from the Server to the Frontend and back again
struct Weather {
s t r i n g text ;
double temperature ;
}
Dlang
i n t e r f a c e Weather {
text : string ,
tempereture : number
}
Typescript
11
dstructtotypescript
dstructtotypescript -i weather.d -p weather.ts -s
→ Weather
12
dstructtotypescript
dstructtotypescript -i weather.d -p weather.ts -s
→ Weather
struct Weather {
string text ;
double temperature ;
}
dstructtotypescript
dstructtotypescript -i weather.d -p weather.ts -s
→ Weather
struct Weather {
string text ;
double temperature ;
}
import std . format ;
foreach ( i t ; __traits (allMembers , Weather) )
dstructtotypescript
dstructtotypescript -i weather.d -p weather.ts -s
→ Weather
struct Weather {
string text ;
double temperature ;
}
import std . format ;
foreach ( i t ; __traits (allMembers , Weather) )
interface Weather {
text : string ,
temperature : number
}
12
Everything is wrong
13
Everything is wrong
• All we solved was a tiny specific problem
• What about server to database
• What if we would use Dart instead of Typescript
• How do we communicate the overall architecture
• How do we keep the architecture in sync with the code
• How do we communicate with non-developer
• ...
14
Everything is wrong
• All we solved was a tiny specific problem
• What about server to database
• What if we would use Dart instead of Typescript
• How do we communicate the overall architecture
• How do we keep the architecture in sync with the code
• How do we communicate with non-developer
• ...
• How do we deal with change?
14
Everything is still wrong
• Waterfall Model
15
Everything is still wrong
• Waterfall Model ← no change, never
15
Everything is still wrong
• Waterfall Model ← no change, never
• Hacking
15
Everything is still wrong
• Waterfall Model ← no change, never
• Hacking ← no plan to speak of, just change
15
Everything is still wrong
• Waterfall Model ← no change, never
• Agile Methods
• Hacking ← no plan to speak of, just change
15
Everything is still wrong
• Waterfall Model ← no change, never
• Agile Methods ← just hacking, with fancy names
• Hacking ← no plan to speak of, just change
15
Everything is still wrong
• Waterfall Model ← no change, never
• UML
• Agile Methods ← just hacking, with fancy names
• Hacking ← no plan to speak of, just change
15
Everything is still wrong
• Waterfall Model ← no change, never
• UML ← just kill me already
• Agile Methods ← just hacking, with fancy names
• Hacking ← no plan to speak of, just change
15
Everything is still wrong
• Waterfall Model ← no change, never
• UML ← just kill me already
• Agile Methods ← just hacking, with fancy names
• Hacking ← no plan to speak of, just change
15
Everything is still wrong
• Waterfall Model ← no change, never
• UML ← just kill me already
• Agile Methods ← just hacking, with fancy names
• Hacking ← no plan to speak of, just change
15
What do we want
• Speak about the system at different levels of detail
with different people
• Quickly introduce people to the system
• Keep data classes (Model) synchronized across
• Frontend
• Server
• Database
• Write only one model for everything, to keep stuff in sync
• Have description line based, because git
• Generate everything possible from the model
16
Introducing the C4 Architecture
Structurizr
• Implements C4 Architecture Model
• Java library to build the model
21
Structurizr
• Implements C4 Architecture Model
• Java library to build the model
• Its code, its fits into git
21
Structurizr
• Implements C4 Architecture Model
• Java library to build the model
• Its code, its fits into git
• Structurizr generates code
21
Structurizr
• Implements C4 Architecture Model
• Java library to build the model
• Its code, its fits into git
• Structurizr generates code
• Only Java and .net
21
How hard can it be
How do we approach the development
• We’re not gonne create a new language
23
How do we approach the development
• We’re not gonne create a new language, at first
23
How do we approach the development
• We’re not gonne create a new language, at first, most likely
23
How do we approach the development
• We’re not gonne create a new language, at first, most likely
• The model (ast) is pretty simple
23
How do we approach the development
• We’re not gonne create a new language, at first, most likely
• The model (ast) is pretty simple
• The world
• The world has
• Actors, software/hardware systems
• A software systems has
• Containers (everything with a unique pid)
• A container has
• Components (think module) and classes
• A component has
• Components and classes
• Classes have members
• Connections between the above
• UML Association, Aggregation, Composition, Dependency,
. . .
• Additional informations, names, descriptions
23
Using Degenerator 1/2
auto world = new TheWorld( ”TheWorld” ) ;
Actor users = world . getOrNewActor ( ”The Users ” ) ;
users . d e s c r i p t i o n = ” This i s a way to long
→ de s c r i p t i o n fo r something ”
~ ” that should be obvious . ” ;
auto system = world . getOrNewSoftwareSystem ( ”
→ AwesomeSoftware” ) ;
24
Using Degenerator 1/2
auto world = new TheWorld( ”TheWorld” ) ;
Actor users = world . getOrNewActor ( ”The Users ” ) ;
users . d e s c r i p t i o n = ” This i s a way to long
→ de s c r i p t i o n fo r something ”
~ ” that should be obvious . ” ;
auto system = world . getOrNewSoftwareSystem ( ”
→ AwesomeSoftware” ) ;
Container frontend = system . getOrNewContainer ( ”
→ Frontend” ) ;
frontend . technology = ”Angular” ;
auto frontendUserCtrl = frontend . getOrNewComponent(
→ ” frontUserCtrl ” ) ;
24
Using Degenerator 2/4
auto database = system . getOrNewContainer ( ”Database”
→ ) ;
database . technology = ”MySQL” ;
world . getOrNew ! Dependency ( ” serverDatabase ” ,
server , database
) . d e s c r i p t i o n = ”CRUD” ;
25
Using Degenerator 2/4
auto database = system . getOrNewContainer ( ”Database”
→ ) ;
database . technology = ”MySQL” ;
world . getOrNew ! Dependency ( ” serverDatabase ” ,
server , database
) . d e s c r i p t i o n = ”CRUD” ;
Class user = getOrNewClass ( ”User” ,
frontendUserCtrl , serverUserCtrl , database
) ;
25
Using Degenerator 3/4
Class user = getOrNewClass ( ”User” ,
frontendUserCtrl , serverUserCtrl , database
) ;
26
Using Degenerator 3/4
Class user = getOrNewClass ( ”User” ,
frontendUserCtrl , serverUserCtrl , database
) ;
MemberVariable userId = user . getOrNew !
→ MemberVariable ( ” id ” ) ;
userId . type = in teger ;
userId . addLandSpecificAttribute ( ”MySQL” , ”PRIMARY
→ KEY” ) ;
userId . addLandSpecificAttribute ( ”MySQL” , ”AUTO
→ INCREMENT” ) ;
26
Using Degenerator 4/4
Class address = getOrNewClass ( ” Address ” ,
frontendUserCtrl , serverUserCtrl , database
) ;
27
Using Degenerator 4/4
Class address = getOrNewClass ( ” Address ” ,
frontendUserCtrl , serverUserCtrl , database
) ;
Aggregation userAddress = world . getOrNew !
→ Aggregation ( ” addressUser ” ,
address , user
) ;
27
Types in Degenerator
• Types
28
Types in Degenerator
• Types e.g. strings are not always strings
28
Types in Degenerator
• Types e.g. strings are not always strings
• D string
• MySQL text
• C++ std::string
28
Types in Degenerator
• Types e.g. strings are not always strings
• D string
• MySQL text
• C++ std::string
struct Type {
s t r i n g name ;
s t r i n g [ s t r i n g ] typeMapping ;
}
auto pwdHash = Type( ” PasswordString ” ) ;
28
Types in Degenerator
• Types e.g. strings are not always strings
• D string
• MySQL text
• C++ std::string
struct Type {
s t r i n g name ;
s t r i n g [ s t r i n g ] typeMapping ;
}
auto pwdHash = Type( ” PasswordString ” ) ;
pwdHash . typeMappings [ ”D” ] = ” s t r i n g ” ;
pwdHash . typeMappings [ ”MySQL” ] = ”VARCHAR(128) ” ;
28
Generating
Graphvic gv = new Graphvic ( world , ”GraphvizOutput” ) ;
gv . generate () ;
MySQL mysql = new MySQL( world , ”MySQL” ) ;
mysql . generate ( database ) ;
29
The World
30
The World and Containers
31
Awesome Software System
32
Generating the Database CREATE TABLE Statements
CREATE TABLE Address {
id LONG PRIMARY KEY
};
CREATE TABLE Address_User {
User_id LONG
FOREIGN KEY(User_id)
→ REFERENCES User ( id ) ON
→ UPDATE CASCADE ON
→ DELETE CASCADE,
Address_id LONG
FOREIGN KEY(Address_id)
→ REFERENCES Address ( id )
→ ON UPDATE CASCADE ON
→ DELETE CASCADE
}
CREATE TABLE User {
id LONG PRIMARY KEY AUTO
→ INCREMENT,
lastname TEXT,
firstname TEXT
};
CREATE TABLE PostelCode {
id LONG PRIMARY KEY AUTO
→ INCREMENT,
code LONG,
Address_id LONG
FOREIGN KEY(Address_id )
→ REFERENCES Address ( id )
→ ON UPDATE CASCADE ON
→ DELETE CASCADE
};
33
What can we generate
• Diagrams describing the project at different levels of detail
• Database schema
• phpmyadmin clones
• Database access code
• Data objects (D struct/class, Typescript interface/class, . . .
• Server skeletons
• Frontend skeletons
34
What can we generate
• Diagrams describing the project at different levels of detail
• Database schema
• phpmyadmin clones
• Database access code
• Data objects (D struct/class, Typescript interface/class, . . .
• Server skeletons
• Frontend skeletons
• Graphviz mostly done, MySQL is getting there, Vibe.d and
Angular2 next
34
The End
• vibe.d https://vibed.org
• typescript https://www.typescriptlang.org/
• dstructtotypescript
https://github.com/burner/dstructtotypescript
• C4 Architecture (Simon Brown)
http://www.codingthearchitecture.com
• Structurizr https://structurizr.com/
• Degenerator https://github.com/burner/Degenerator
36

Mais conteúdo relacionado

Mais procurados

Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
Introduction to Rust language programming
Introduction to Rust language programmingIntroduction to Rust language programming
Introduction to Rust language programmingRodolfo Finochietti
 
Optimizing Communicating Event-Loop Languages with Truffle
Optimizing Communicating Event-Loop Languages with TruffleOptimizing Communicating Event-Loop Languages with Truffle
Optimizing Communicating Event-Loop Languages with TruffleStefan Marr
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)Ontico
 
Tips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeTips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeKenneth Geisshirt
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Codemotion
 
10 reasons to be excited about go
10 reasons to be excited about go10 reasons to be excited about go
10 reasons to be excited about goDvir Volk
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersJen Yee Hong
 
2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - englishJen Yee Hong
 
DConf 2016: Bitpacking Like a Madman by Amaury Sechet
DConf 2016: Bitpacking Like a Madman by Amaury SechetDConf 2016: Bitpacking Like a Madman by Amaury Sechet
DConf 2016: Bitpacking Like a Madman by Amaury SechetAndrei Alexandrescu
 
Redesigning Common Lisp
Redesigning Common LispRedesigning Common Lisp
Redesigning Common Lispfukamachi
 
Triton and symbolic execution on gdb
Triton and symbolic execution on gdbTriton and symbolic execution on gdb
Triton and symbolic execution on gdbWei-Bo Chen
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtoolingDouglas Chen
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Romain Dorgueil
 

Mais procurados (20)

Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Introduction to Rust language programming
Introduction to Rust language programmingIntroduction to Rust language programming
Introduction to Rust language programming
 
Optimizing Communicating Event-Loop Languages with Truffle
Optimizing Communicating Event-Loop Languages with TruffleOptimizing Communicating Event-Loop Languages with Truffle
Optimizing Communicating Event-Loop Languages with Truffle
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
 
Tips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeTips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native code
 
Klee and angr
Klee and angrKlee and angr
Klee and angr
 
Node.js - Best practices
Node.js  - Best practicesNode.js  - Best practices
Node.js - Best practices
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
 
Node.js extensions in C++
Node.js extensions in C++Node.js extensions in C++
Node.js extensions in C++
 
10 reasons to be excited about go
10 reasons to be excited about go10 reasons to be excited about go
10 reasons to be excited about go
 
C++ Coroutines
C++ CoroutinesC++ Coroutines
C++ Coroutines
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmers
 
2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
 
DConf 2016: Bitpacking Like a Madman by Amaury Sechet
DConf 2016: Bitpacking Like a Madman by Amaury SechetDConf 2016: Bitpacking Like a Madman by Amaury Sechet
DConf 2016: Bitpacking Like a Madman by Amaury Sechet
 
Redesigning Common Lisp
Redesigning Common LispRedesigning Common Lisp
Redesigning Common Lisp
 
Triton and symbolic execution on gdb
Triton and symbolic execution on gdbTriton and symbolic execution on gdb
Triton and symbolic execution on gdb
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling
 
Extending Node.js using C++
Extending Node.js using C++Extending Node.js using C++
Extending Node.js using C++
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
 

Destaque

Informática básica
Informática básicaInformática básica
Informática básicaMishell1205
 
Estudio de caso tecnologia y sociedad
Estudio de caso tecnologia y sociedadEstudio de caso tecnologia y sociedad
Estudio de caso tecnologia y sociedadRicardo Valencia
 
Ket tap, ke thua
Ket tap, ke thuaKet tap, ke thua
Ket tap, ke thuaTuan Do
 
Message from Merida, WILD9
Message from Merida, WILD9Message from Merida, WILD9
Message from Merida, WILD9WILD Foundation
 
Colectivo de comunicaciones ever toro
Colectivo de comunicaciones ever toroColectivo de comunicaciones ever toro
Colectivo de comunicaciones ever toroEver Jesus Toro Toro
 
Comentario sobre las redes
Comentario sobre las redesComentario sobre las redes
Comentario sobre las redesluislossa
 
Presentacion de Power Point
Presentacion de Power PointPresentacion de Power Point
Presentacion de Power PointEdith Navarro
 
Responding in Times of Crisis: Providing Psychological First Aid
Responding in Times of Crisis: Providing Psychological First AidResponding in Times of Crisis: Providing Psychological First Aid
Responding in Times of Crisis: Providing Psychological First AidBernie McCann
 
TIRADS SCORING : its Efficacy and Accuracy
TIRADS SCORING : its Efficacy and AccuracyTIRADS SCORING : its Efficacy and Accuracy
TIRADS SCORING : its Efficacy and AccuracyRoshan Valentine
 

Destaque (14)

Informática básica
Informática básicaInformática básica
Informática básica
 
Halaman persetujuan juli
Halaman  persetujuan juliHalaman  persetujuan juli
Halaman persetujuan juli
 
Estudio de caso tecnologia y sociedad
Estudio de caso tecnologia y sociedadEstudio de caso tecnologia y sociedad
Estudio de caso tecnologia y sociedad
 
Ket tap, ke thua
Ket tap, ke thuaKet tap, ke thua
Ket tap, ke thua
 
Message from Merida, WILD9
Message from Merida, WILD9Message from Merida, WILD9
Message from Merida, WILD9
 
Los 7 saberes
Los 7 saberesLos 7 saberes
Los 7 saberes
 
Trading Derivados22/03/2013
Trading Derivados22/03/2013Trading Derivados22/03/2013
Trading Derivados22/03/2013
 
Colectivo de comunicaciones ever toro
Colectivo de comunicaciones ever toroColectivo de comunicaciones ever toro
Colectivo de comunicaciones ever toro
 
Comentario sobre las redes
Comentario sobre las redesComentario sobre las redes
Comentario sobre las redes
 
Guia de antidepresivos. 1
Guia de antidepresivos. 1Guia de antidepresivos. 1
Guia de antidepresivos. 1
 
Presentacion de Power Point
Presentacion de Power PointPresentacion de Power Point
Presentacion de Power Point
 
Responding in Times of Crisis: Providing Psychological First Aid
Responding in Times of Crisis: Providing Psychological First AidResponding in Times of Crisis: Providing Psychological First Aid
Responding in Times of Crisis: Providing Psychological First Aid
 
TIRADS SCORING : its Efficacy and Accuracy
TIRADS SCORING : its Efficacy and AccuracyTIRADS SCORING : its Efficacy and Accuracy
TIRADS SCORING : its Efficacy and Accuracy
 
Ccna new syllabus
Ccna new syllabusCcna new syllabus
Ccna new syllabus
 

Semelhante a Asynchronous single page applications without a line of HTML or Javascript, or why D is just awesome

FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023Matthew Groves
 
PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)
PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)
PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)PyData
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rockmartincronje
 
Ten practical ways to improve front-end performance
Ten practical ways to improve front-end performanceTen practical ways to improve front-end performance
Ten practical ways to improve front-end performanceAndrew Rota
 
MySQL Performance Monitoring
MySQL Performance MonitoringMySQL Performance Monitoring
MySQL Performance Monitoringspil-engineering
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuningAOE
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbMongoDB APAC
 
Cassandra drivers and libraries
Cassandra drivers and librariesCassandra drivers and libraries
Cassandra drivers and librariesDuyhai Doan
 
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)Ontico
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter HiltonPlay framework 2 : Peter Hilton
Play framework 2 : Peter HiltonJAX London
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and DesktopElizabeth Smith
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixC4Media
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for CassandraEdward Capriolo
 
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"DataStax Academy
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first designKyrylo Reznykov
 
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsBeyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsDataWorks Summit
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)Jose Manuel Pereira Garcia
 

Semelhante a Asynchronous single page applications without a line of HTML or Javascript, or why D is just awesome (20)

FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023
 
PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)
PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)
PyCascading for Intuitive Flow Processing with Hadoop (gabor szabo)
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rock
 
Ten practical ways to improve front-end performance
Ten practical ways to improve front-end performanceTen practical ways to improve front-end performance
Ten practical ways to improve front-end performance
 
Rails israel 2013
Rails israel 2013Rails israel 2013
Rails israel 2013
 
MySQL Performance Monitoring
MySQL Performance MonitoringMySQL Performance Monitoring
MySQL Performance Monitoring
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
Revealing ALLSTOCKER
Revealing ALLSTOCKERRevealing ALLSTOCKER
Revealing ALLSTOCKER
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
 
Cassandra drivers and libraries
Cassandra drivers and librariesCassandra drivers and libraries
Cassandra drivers and libraries
 
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter HiltonPlay framework 2 : Peter Hilton
Play framework 2 : Peter Hilton
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first design
 
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsBeyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
 
JavaScripts & jQuery
JavaScripts & jQueryJavaScripts & jQuery
JavaScripts & jQuery
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 

Último

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Último (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

Asynchronous single page applications without a line of HTML or Javascript, or why D is just awesome

  • 1. Asynchronous Single Page Applications without a Line of HTML or Javascript. Or why D is just awesome Robert ”burner” Schadek May 5, 2016 DConf
  • 2. Javascript and HTML are awesome • No explicit types • Variables may be undefined • Repetition repetition repetition • No templates • No compile time function execution • No compile time 1
  • 3.
  • 4. Goals • Retain type-information of data from DB to Client’s Browser 3
  • 5. Goals • Retain type-information of data from DB to Client’s Browser • Keeping things DRY 3
  • 6. Goals • Retain type-information of data from DB to Client’s Browser • Keeping things DRY • Performance 3
  • 7. Goals • Retain type-information of data from DB to Client’s Browser • Keeping things DRY • Performance • Get things done 3
  • 9. Vibe.d • Powerful asynchronous I/O and web toolkit for D • Uses Fibers and Threads 4
  • 10. Vibe.d • Powerful asynchronous I/O and web toolkit for D • Uses Fibers and Threads • n → m mapping • yield() • async IO 4
  • 11. Vibe.d • Powerful asynchronous I/O and web toolkit for D • Uses Fibers and Threads • n → m mapping • yield() • async IO • async DB connectivity for MongoDB, Redis, MySQL • You don’t need to care about async • Web interface generator • REST interface generator 4
  • 12. REST Interface Generator i n t e r f a c e MyAPI { // GET /weather −> responds {” text ”: ” . . . ” , ” → temperature ”: . . . } Weather getWeather () ; } 5
  • 13. REST Interface Generator i n t e r f a c e MyAPI { // GET /weather −> responds {” text ”: ” . . . ” , ” → temperature ”: . . . } Weather getWeather () ; } c l a s s MyAPIImplementation : MyAPI { auto weather = [ ”sunny” , ” rainy ” , ” cats and dogs ” → , ”snow” ] ; Weather getWeather () { return Weather ( weather [ uniform (0 , weather . length ) ] , uniform ( −10 ,30) ) ; } } 5
  • 14. REST Interface Generator auto router = new URLRouter ; router . get ( ”/” , staticTemplate ! ” index . dt” ) ; router . get ( ”/main . html” , staticTemplate ! ”main . dt” ) ; router . r e g i s t e r R e s t I n t e r f a c e !MyAPI(new → MyAPIImplementation , r e s t s e t t i n g s ) ; 6
  • 15. REST Interface Generator auto router = new URLRouter ; router . get ( ”/” , staticTemplate ! ” index . dt” ) ; router . get ( ”/main . html” , staticTemplate ! ”main . dt” ) ; router . r e g i s t e r R e s t I n t e r f a c e !MyAPI(new → MyAPIImplementation , r e s t s e t t i n g s ) ; struct Weather { s t r i n g text ; double temperature ; } 6
  • 16. AngularJS Typescript i n t e r f a c e Weather { text : string , temperature : number } 7
  • 17. AngularJS Typescript i n t e r f a c e Weather { text : string , temperature : number } i n t e r f a c e MainScope extends ng . IScope { weather : Weather } 7
  • 18. AngularJS Typescript i n t e r f a c e Weather { text : string , temperature : number } i n t e r f a c e MainScope extends ng . IScope { weather : Weather } c l a s s MainCtrl { public s t a t i c $ i n j e c t = [ ’ $scope ’ , ’ $http ’ ] ; constructor ( private $scope : MainScope , private $http : ng . IHttpService ) { t h i s . weather () ; } 7
  • 19. AngularJS Typescript weather () : void { var s = ’ /weather ’ ; t h i s . $http . get ( s ) . success (( data : Weather ) => { t h i s . $scope . weather = data ; }) ; } 8
  • 20. Diet doctype html html (ng−app=”myapp”) head t i t l e DConf 2016 Weather − j a v a s c r i p t ( ” . / angular . j s ”) ; − j a v a s c r i p t ( ” . / angular−route . j s ”) ; − j a v a s c r i p t ( ” . / myapp . j s ”) ; body div (ng−view ) 9
  • 21. Diet doctype html html (ng−app=”myapp”) head t i t l e DConf 2016 Weather − j a v a s c r i p t ( ” . / angular . j s ”) ; − j a v a s c r i p t ( ” . / angular−route . j s ”) ; − j a v a s c r i p t ( ” . / myapp . j s ”) ; body div (ng−view ) − void j a v a s c r i p t ( s t r i n g name) s c r i p t ( src=”#{name}”) 9
  • 22. Diet . container p {{ weather . text }} p {{ weather . temperature }} button ( type=”submit ” ,ng−c l i c k =” c t r l . weather () ; ” ) → Get Weather 10
  • 24. Dataflow from the Server to the Frontend and back again
  • 25. Dataflow from the Server to the Frontend and back again struct Weather { s t r i n g text ; double temperature ; } Dlang 11
  • 26. Dataflow from the Server to the Frontend and back again struct Weather { s t r i n g text ; double temperature ; } Dlang i n t e r f a c e Weather { text : string , tempereture : number } Typescript 11
  • 27. dstructtotypescript dstructtotypescript -i weather.d -p weather.ts -s → Weather 12
  • 28. dstructtotypescript dstructtotypescript -i weather.d -p weather.ts -s → Weather struct Weather { string text ; double temperature ; }
  • 29. dstructtotypescript dstructtotypescript -i weather.d -p weather.ts -s → Weather struct Weather { string text ; double temperature ; } import std . format ; foreach ( i t ; __traits (allMembers , Weather) )
  • 30. dstructtotypescript dstructtotypescript -i weather.d -p weather.ts -s → Weather struct Weather { string text ; double temperature ; } import std . format ; foreach ( i t ; __traits (allMembers , Weather) ) interface Weather { text : string , temperature : number } 12
  • 32. 13
  • 33. Everything is wrong • All we solved was a tiny specific problem • What about server to database • What if we would use Dart instead of Typescript • How do we communicate the overall architecture • How do we keep the architecture in sync with the code • How do we communicate with non-developer • ... 14
  • 34. Everything is wrong • All we solved was a tiny specific problem • What about server to database • What if we would use Dart instead of Typescript • How do we communicate the overall architecture • How do we keep the architecture in sync with the code • How do we communicate with non-developer • ... • How do we deal with change? 14
  • 35. Everything is still wrong • Waterfall Model 15
  • 36. Everything is still wrong • Waterfall Model ← no change, never 15
  • 37. Everything is still wrong • Waterfall Model ← no change, never • Hacking 15
  • 38. Everything is still wrong • Waterfall Model ← no change, never • Hacking ← no plan to speak of, just change 15
  • 39. Everything is still wrong • Waterfall Model ← no change, never • Agile Methods • Hacking ← no plan to speak of, just change 15
  • 40. Everything is still wrong • Waterfall Model ← no change, never • Agile Methods ← just hacking, with fancy names • Hacking ← no plan to speak of, just change 15
  • 41. Everything is still wrong • Waterfall Model ← no change, never • UML • Agile Methods ← just hacking, with fancy names • Hacking ← no plan to speak of, just change 15
  • 42. Everything is still wrong • Waterfall Model ← no change, never • UML ← just kill me already • Agile Methods ← just hacking, with fancy names • Hacking ← no plan to speak of, just change 15
  • 43. Everything is still wrong • Waterfall Model ← no change, never • UML ← just kill me already • Agile Methods ← just hacking, with fancy names • Hacking ← no plan to speak of, just change 15
  • 44. Everything is still wrong • Waterfall Model ← no change, never • UML ← just kill me already • Agile Methods ← just hacking, with fancy names • Hacking ← no plan to speak of, just change 15
  • 45. What do we want • Speak about the system at different levels of detail with different people • Quickly introduce people to the system • Keep data classes (Model) synchronized across • Frontend • Server • Database • Write only one model for everything, to keep stuff in sync • Have description line based, because git • Generate everything possible from the model 16
  • 46. Introducing the C4 Architecture
  • 47.
  • 48.
  • 49.
  • 50.
  • 51. Structurizr • Implements C4 Architecture Model • Java library to build the model 21
  • 52. Structurizr • Implements C4 Architecture Model • Java library to build the model • Its code, its fits into git 21
  • 53. Structurizr • Implements C4 Architecture Model • Java library to build the model • Its code, its fits into git • Structurizr generates code 21
  • 54. Structurizr • Implements C4 Architecture Model • Java library to build the model • Its code, its fits into git • Structurizr generates code • Only Java and .net 21
  • 55.
  • 56. How hard can it be
  • 57. How do we approach the development • We’re not gonne create a new language 23
  • 58. How do we approach the development • We’re not gonne create a new language, at first 23
  • 59. How do we approach the development • We’re not gonne create a new language, at first, most likely 23
  • 60. How do we approach the development • We’re not gonne create a new language, at first, most likely • The model (ast) is pretty simple 23
  • 61. How do we approach the development • We’re not gonne create a new language, at first, most likely • The model (ast) is pretty simple • The world • The world has • Actors, software/hardware systems • A software systems has • Containers (everything with a unique pid) • A container has • Components (think module) and classes • A component has • Components and classes • Classes have members • Connections between the above • UML Association, Aggregation, Composition, Dependency, . . . • Additional informations, names, descriptions 23
  • 62. Using Degenerator 1/2 auto world = new TheWorld( ”TheWorld” ) ; Actor users = world . getOrNewActor ( ”The Users ” ) ; users . d e s c r i p t i o n = ” This i s a way to long → de s c r i p t i o n fo r something ” ~ ” that should be obvious . ” ; auto system = world . getOrNewSoftwareSystem ( ” → AwesomeSoftware” ) ; 24
  • 63. Using Degenerator 1/2 auto world = new TheWorld( ”TheWorld” ) ; Actor users = world . getOrNewActor ( ”The Users ” ) ; users . d e s c r i p t i o n = ” This i s a way to long → de s c r i p t i o n fo r something ” ~ ” that should be obvious . ” ; auto system = world . getOrNewSoftwareSystem ( ” → AwesomeSoftware” ) ; Container frontend = system . getOrNewContainer ( ” → Frontend” ) ; frontend . technology = ”Angular” ; auto frontendUserCtrl = frontend . getOrNewComponent( → ” frontUserCtrl ” ) ; 24
  • 64. Using Degenerator 2/4 auto database = system . getOrNewContainer ( ”Database” → ) ; database . technology = ”MySQL” ; world . getOrNew ! Dependency ( ” serverDatabase ” , server , database ) . d e s c r i p t i o n = ”CRUD” ; 25
  • 65. Using Degenerator 2/4 auto database = system . getOrNewContainer ( ”Database” → ) ; database . technology = ”MySQL” ; world . getOrNew ! Dependency ( ” serverDatabase ” , server , database ) . d e s c r i p t i o n = ”CRUD” ; Class user = getOrNewClass ( ”User” , frontendUserCtrl , serverUserCtrl , database ) ; 25
  • 66. Using Degenerator 3/4 Class user = getOrNewClass ( ”User” , frontendUserCtrl , serverUserCtrl , database ) ; 26
  • 67. Using Degenerator 3/4 Class user = getOrNewClass ( ”User” , frontendUserCtrl , serverUserCtrl , database ) ; MemberVariable userId = user . getOrNew ! → MemberVariable ( ” id ” ) ; userId . type = in teger ; userId . addLandSpecificAttribute ( ”MySQL” , ”PRIMARY → KEY” ) ; userId . addLandSpecificAttribute ( ”MySQL” , ”AUTO → INCREMENT” ) ; 26
  • 68. Using Degenerator 4/4 Class address = getOrNewClass ( ” Address ” , frontendUserCtrl , serverUserCtrl , database ) ; 27
  • 69. Using Degenerator 4/4 Class address = getOrNewClass ( ” Address ” , frontendUserCtrl , serverUserCtrl , database ) ; Aggregation userAddress = world . getOrNew ! → Aggregation ( ” addressUser ” , address , user ) ; 27
  • 71. Types in Degenerator • Types e.g. strings are not always strings 28
  • 72. Types in Degenerator • Types e.g. strings are not always strings • D string • MySQL text • C++ std::string 28
  • 73. Types in Degenerator • Types e.g. strings are not always strings • D string • MySQL text • C++ std::string struct Type { s t r i n g name ; s t r i n g [ s t r i n g ] typeMapping ; } auto pwdHash = Type( ” PasswordString ” ) ; 28
  • 74. Types in Degenerator • Types e.g. strings are not always strings • D string • MySQL text • C++ std::string struct Type { s t r i n g name ; s t r i n g [ s t r i n g ] typeMapping ; } auto pwdHash = Type( ” PasswordString ” ) ; pwdHash . typeMappings [ ”D” ] = ” s t r i n g ” ; pwdHash . typeMappings [ ”MySQL” ] = ”VARCHAR(128) ” ; 28
  • 75. Generating Graphvic gv = new Graphvic ( world , ”GraphvizOutput” ) ; gv . generate () ; MySQL mysql = new MySQL( world , ”MySQL” ) ; mysql . generate ( database ) ; 29
  • 77. The World and Containers 31
  • 79. Generating the Database CREATE TABLE Statements CREATE TABLE Address { id LONG PRIMARY KEY }; CREATE TABLE Address_User { User_id LONG FOREIGN KEY(User_id) → REFERENCES User ( id ) ON → UPDATE CASCADE ON → DELETE CASCADE, Address_id LONG FOREIGN KEY(Address_id) → REFERENCES Address ( id ) → ON UPDATE CASCADE ON → DELETE CASCADE } CREATE TABLE User { id LONG PRIMARY KEY AUTO → INCREMENT, lastname TEXT, firstname TEXT }; CREATE TABLE PostelCode { id LONG PRIMARY KEY AUTO → INCREMENT, code LONG, Address_id LONG FOREIGN KEY(Address_id ) → REFERENCES Address ( id ) → ON UPDATE CASCADE ON → DELETE CASCADE }; 33
  • 80. What can we generate • Diagrams describing the project at different levels of detail • Database schema • phpmyadmin clones • Database access code • Data objects (D struct/class, Typescript interface/class, . . . • Server skeletons • Frontend skeletons 34
  • 81. What can we generate • Diagrams describing the project at different levels of detail • Database schema • phpmyadmin clones • Database access code • Data objects (D struct/class, Typescript interface/class, . . . • Server skeletons • Frontend skeletons • Graphviz mostly done, MySQL is getting there, Vibe.d and Angular2 next 34
  • 82.
  • 83. The End • vibe.d https://vibed.org • typescript https://www.typescriptlang.org/ • dstructtotypescript https://github.com/burner/dstructtotypescript • C4 Architecture (Simon Brown) http://www.codingthearchitecture.com • Structurizr https://structurizr.com/ • Degenerator https://github.com/burner/Degenerator 36