ThinkBeyondFrameworks,
theRealGemsareinthe
Languages
Naresha K
Chief Technologist, Channel Bridge Software Labs
naresha.k@gmail.com
@naresha_k
1
2
DISCLAIMER
3
The contents of this presentation may
hurt your feelings! Proceed with
caution
4
5
6
Grails
4
Opensource,
Forums, Slack
Community3
On-demand
capabilities,
Reuse, Share
Plugin Ecosystem
2
Convention over
configuration,
Groovy
Productivity1
JVM, Spring,
Hibernate
Built on proven tech
BusinessGoals
8
1
Time To Market
2
Economy
9
10
Layer 4
Layer 3
Layer 2
Layer 1
Whatittakestosucceed?
12
Architecture
Framework
Domain
Practices
Libraries
Language
13
Whyshould
wecareforthe
language?
ProgrammingConcepts
Objects
Functions
Higher Order Functions
Inheritance
Encapsulation
Polymorphism
Statically Typed
Dynamic Typing
Immutability
Composition
Parallel processing
Lazy Evaluation
15
Frameworks
reflect the opinion
of the language
they are built on
16
Lesser the
opinionated the
language => more
decisions to be made
by it’s users
Groovy&GrailsEvolution
TIMELINES
17
Initial
Dynamic
Groovy 2.0
Static Typing
Groovy 1.6
AST
Transformation
18
Language Evolution
Influences Framework
Evolution
19
20
Groovy
&
Grails
21
https://twitter.com/venkat_s/status/815686401870200833
SpecifyingTypes
22
def	
  friend	
  =	
  new	
  Person(name:	
  'Raj')
def	
  friend	
  =	
  new	
  Person(name:	
  'Raj')
def	
  friend	
  =	
  new	
  Person(name:	
  'Raj')
def friend = new Person(name: ‘Ravi')
// vs
Person me = new Person(name: 'Naresha')
SpecifyingTypes
23
class Person {
String name
Integer age
}
SpecifyingTypes
24
class MyController {
def myService
// vs
AnotherService anotherService
}
Hierarchies->Capabilities
25
1 Inheritance
2 Composition (Traits)
LeveragingMetaProgramming
26
class MyService {
@Transactional(propagation = Propagation.REQUIRES_NEW)
def m1(){}
def m2() {
m1()
// vs
myProxy.m1()
}
}
LeveragingMetaProgramming
27
sc.clazz.metaClass.getMyProxy = { ->
grailsApplication.mainContext.getBean(propertyName)
}
LeveragingDSLs
28
class MenuItem {
String menuCode
String group
String label
String controller
String action
}
LeveragingDSLs
29
menuItems = [
new MenuItem(
menuCode: 'customer_new',
group: ‘customer',
label: 'Add Customer',
controller: ‘customer',
action: 'create'
),
]
LeveragingDSLs
30
menuItems = [
menuItem {
menuCode 'customer_new'
group 'customer'
label: 'Add Customer'
controller: 'customer'
action: 'create'
}
]
LeveragingDSLs
31
menuItems = [
menuItem {
menuCode 'customer_new'
group 'customer'
label 'Add Customer'
controller 'customer'
action 'create'
}
]
LeveragingDSLs
32
class MenuItem {
String menuCode
// Other attributes
def menuItem(Closure config){}
menuCode(val) { menuCode = val}
}
33
Frameworks are
gateways to
productivity, not
barriers for
innovation
Think Beyond Frameworks,
Learn Languages
Happy Learning…
“

Think beyond frameworks, The real gems are in the languages