Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.


From Java to Scala

Introduction to Scala through conversion of an Android Java application

Ittay Dror

on 23 December 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of From Java to Scala

Stacking Feed parser
Composite What's left out Better Generics
Lazy members, args
Self types
Structural types
Package objects
Renaming imports
XML support
Tailcall optimization
Existential types Generalized type constraints
Exception handling
Higher kinds
Path dependent types
Unicode files
Abstract types
Bridge methods
Compiler plugins
For comprehensions
this bounds
Delimited continuations Lines of code Java: 764
Scala: 382 To On The Scala logo is a trademark of EPFL The Java logo is a trademark of Oracle The Android logo is a trademark of Google Traits Multiple inheritance in code,
single inheritance in bytecode Enhanced Functionality Need to merge cached feed with current
Sort & merge Groups
Articles Group
feed url ArticleInfo
url Domain Model Not just getters and setters Pattern Matching -
Declerations, not Conditions Article reader @ tikalk.com Settings Activity "a single, focused thing that the user can do"
The controller of a GUI Screen
Create view programmatically or from XML layout
React to events ListActivity An activity for displaying lists
Predefined views
onListItemClicked ListAdapter Converts a list of elements to row views
Implement a getView method Get all groups
Populate list view using adapter
Get previously selected groups and tick the matching items
onListItemClicked: tick/untick the group and save Flow Settings SharedPreferences can store simple types Groups Get selected groups from Settings
Populate list view using adapter
onListItemClicked: Open ArticlesActivity Flow Articles An XML for arranging widgets
"Inflated" to objects
Optional widget ID with auto generated constant
IDs used in activity to set values in widgets Layout Conclusion Is Scala Complex? Class Definition Collections Disadvantages:
New class
Modifications between next() invalidate state
next() may throw NoSuchElementException loop on all elements, apply a function Type Inference Functions "Classes are really the only modeling tool Java provides you. So whenever a new idea occurs to you, you have to sculpt it or wrap it or smash at it until it becomes a thing, even if it began life as an action, a process, or any other non-"thing" concept." Steve Yegge
Execution in the Kingdom of Nouns Inversion of Control The compiler works for us Beyond syntactic sugar Implicit Arguments Additional Functionality Go parallel "Java@http://www.tikalk.com/java,.Net@http://www.tikalk.com/net" "well, as a novice, i did get confused by the examples, and could not explain to myself why they behave differently." Ittay Dror, 04/04/06 Is it worth learning Hibernate, Spring, Guice, ...? Is it worth it? What we saw Case classes
Named arguments, default values
Pattern matching
Class definition
Type inference
Collections / Functions
Implicit arguments
Objects Iterator foreach Ittay Dror
ittayd@tikalk.com The Select desired groups: Main screen (selected groups) Clicking a group opens articles list Java Case Classes @ittayd JVM
Object Oriented
Statically Typed
Productive Martin Odersky
Since 2003
Version 2.9
~30 active comitters Ittay Dror
Over 15 years of enterprise development, focusing in Java

“I am Tikal's CTO
With over 90 members, we meet, share, contribute and code together on a monthly basis. “ Who am I We help companies build, deliver,
deploy, manage and optimize their products.
Full transcript