lift scaffolding from existing database

17
Lift Scaffolding from existing database [email protected]

Upload: talexandre

Post on 15-May-2015

2.007 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Lift scaffolding from existing database

Lift Scaffolding from existing database

[email protected]

Page 2: Lift scaffolding from existing database

Goal

Ease the “getting started” step when migrating from Java to Scala A lot of the legacy is in the Database

Among many alternatives, choose one that fits java programmers with a stack they are familiar with:

demo based on the Lift JPA sample application

Page 2

Page 3: Lift scaffolding from existing database

Scala-tools repositoryhttp://www.scala-tools.org/repo-releases/net/liftweb/

Page 3

lift-archetype-basic

lift-archetype-blank

lift-archetype-hellolift

lift-archetype-jpa-basic

lift-archetype-sbt

lift-archetype-jpa-blank

lift-archetype-jpa-blank-single

Page 4: Lift scaffolding from existing database

Scala FARM(Framework for Automatic Relational Mapping)

Features:

DOG: Domain Object Generator for JPA compliant entities (one class per table)

CAT: Testdata by extracting database data into XML files

Test code to create a lift database for your integration tests

COW: Lift scaffolding i.e. snippets for CRUD with their corresponding HTML views (list, add, search)

MOUSE: Model classes containing common Sql Queries

Third parties: scalate, configgy, dbunit

Page 4

Page 5: Lift scaffolding from existing database

Live coding

Page 5

Page 6: Lift scaffolding from existing database

ROADMAP

Page 6

Page 7: Lift scaffolding from existing database

Support Other Frameworks

Play

Bowler

Akka-based, e.g. Spray

Blueeyes

Page 7

Page 8: Lift scaffolding from existing database

Create own mappings

Page 8

Page 9: Lift scaffolding from existing database

Refactoring

Groovy SQL API: Sql.eachRow(GString gstring,Closure metaClosure, Closure rowClosure)

Scala:

Page 9

Page 10: Lift scaffolding from existing database

Refactoring, imperative style

Page 10

Page 11: Lift scaffolding from existing database

Functional

Page 11

Page 12: Lift scaffolding from existing database

Functional with defaults

Page 12

Page 13: Lift scaffolding from existing database

Usage of eachRow(resultSet,metaClosure,rowClosure)

Page 13

Page 14: Lift scaffolding from existing database

Page 14

Do You Have Any Questions?

https://github.com/ThomasAlexandre/scalafarm.git

Page 15: Lift scaffolding from existing database

list.scaml

Page 15

Page 16: Lift scaffolding from existing database

Domain Entity

Page 16

Page 17: Lift scaffolding from existing database

Scalate Template for Domain Entities

Page 17

etc…