Your SlideShare is downloading. ×
Groovy MOPping
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Groovy MOPping

496
views

Published on

Every developer dreams about big red button to do everything he needs. MOP (Metaobject protocol) in Groovy is a way to get close to that dream. There is a presentation of meta programming concepts in …

Every developer dreams about big red button to do everything he needs. MOP (Metaobject protocol) in Groovy is a way to get close to that dream. There is a presentation of meta programming concepts in Groovy and what benefits you can get from it.

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
496
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Groovy MOPping Izzet Mustafayev@EPAM Systems @webdizz http://webdizz.name
  • 2. this is me ● SA at EPAM Systems ● primary skill Java ● hands-on-coding with Ruby, Groovy, some Scala ● passion about agile, clean code practices and devops
  • 3. agenda ● Groovy ● MOP... what? ● AOP ● method injection/synthesis ● AST ● summary ● q&a
  • 4. Groovy
  • 5. Groovy is an agile dynamic language
  • 6. Java is a Groovy but Groovy is not Java
  • 7. Groovy supports DSL
  • 8. Groovy provides statically type check
  • 9. MOP...?
  • 10. MOP Example GORM class Person { String name Integer age Date lastVisit } ​ Person.findByName('Jack')
  • 11. Groovy Object package groovy.lang; public interface GroovyObject { Object invokeMethod(String name, Object args); Object getProperty(String property); void setProperty(String property, Object newValue); MetaClass getMetaClass(); void setMetaClass(MetaClass metaClass); }
  • 12. Object operation str = 'hello' method = str.metaClass.getMetaMethod ('toUpperCase') ​ println method.invoke(str) // HELLO
  • 13. AOP
  • 14. groovy.lang.GroovyInterceptable#invokeMethod
  • 15. groovy.lang.MetaClass#invokeMethod
  • 16. method injection
  • 17. Category
  • 18. ExpandoMetaClass
  • 19. Class Instance
  • 20. Mixing
  • 21. method synthesis
  • 22. methodMissing()
  • 23. ExpandoMetaClass
  • 24. AST transformations
  • 25. interception
  • 26. injection
  • 27. summary
  • 28. DSL
  • 29. Source Analysis
  • 30. Dependency Management
  • 31. references ● Groovy http://groovy.codehaus.org/ ● CodeNarc http://codenarc.sourceforge.net/ ● Gradle http://www.gradle.org/ ● Gant http://gant.codehaus.org/ ● Writting DSL http://groovy.codehaus.org/Writing+DomainSpecific+Languages ● Dynamic Groovy http://groovy.codehaus. org/Dynamic+Groovy ● Demo sources https://github.com/webdizz/groovy-mopping
  • 32. q&a
  • 33. thank you! Groovy MOPping Izzet Mustafayev@EPAM Systems @webdizz http://webdizz.name

×