SlideShare una empresa de Scribd logo
1 de 24
Scala a successor to java CWI team
Agenda ,[object Object],www.exoplatform.com Copyright 2011 eXo Platform ,[object Object]
Scala a successor to java
www.exoplatform.com Copyright 2011 eXo Platform What is Scala ,[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Problem with statically typed language ,[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform How to do better ,[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Why unifies FP and OOP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform 1 st  Unification ADTs are class hierarchies Many functional languages have algebraic data types and pattern matching =>Concise and canonical manipulation of data structure From object-oriented point of view -”ADTs are not extensible” - “ADTs violate the purity of the OO data model” - “Pattern matching breaks encapsulation”  => using class  hierarchies.
www.exoplatform.com Copyright 2011 eXo Platform 1 st  Unification ADTs are class hierarchies With class hierarchies contents is encapsulaated in the object and accessed through methods With ADTs : data is accessed through decomposing the value by pattern matching ADTs and class hierarchies have complementary strength and weakness - ADTs allow easy extension of operations supported by the data - While class hierarchies allow easy addition of data variants
www.exoplatform.com Copyright 2011 eXo Platform 1 st  Unification ADTs are class hierarchies ADTs can be encoded using case classes - Case classes are like normal classes. - Instance constructors can be recovered by pattern matching - Structural equality is used for comparison - The new keyword is optional for instance creation. Case class ClockTime(hour: Int, min:Int) is a valid case class definition. ClockTime(10,30) creates an instance
www.exoplatform.com Copyright 2011 eXo Platform 2 nd  Unification : functions are objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform The type of function  ,[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Taking advantage of function ,[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Functional programming style ,[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Modular system with single inheritance ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform 3 rd  Unification: modules are objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Components in Scala ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Mixins ,[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Traits ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Inheriting trait ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Requiring a behaviour ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
www.exoplatform.com Copyright 2011 eXo Platform Concurrent programming ,[object Object],[object Object],[object Object]
Q & A
Thank you!

Más contenido relacionado

La actualidad más candente

Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
JAXLondon2014
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
prakash185645
 
Jade V
Jade VJade V
Jade V
tmtm99
 

La actualidad más candente (19)

Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
 
Java features
Java featuresJava features
Java features
 
All about agents jade
All about agents jadeAll about agents jade
All about agents jade
 
VB.net
VB.netVB.net
VB.net
 
Java notes
Java notesJava notes
Java notes
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
Core java online training
Core java online trainingCore java online training
Core java online training
 
Learn Java with Dr. Rifat Shahriyar
Learn Java with Dr. Rifat ShahriyarLearn Java with Dr. Rifat Shahriyar
Learn Java with Dr. Rifat Shahriyar
 
Java rmi
Java rmiJava rmi
Java rmi
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
 
Adapter design-pattern2015
Adapter design-pattern2015Adapter design-pattern2015
Adapter design-pattern2015
 
Jade V
Jade VJade V
Jade V
 
PHP 5
PHP 5PHP 5
PHP 5
 
SMI - Introduction to Java
SMI - Introduction to JavaSMI - Introduction to Java
SMI - Introduction to Java
 
Java introduction
Java introductionJava introduction
Java introduction
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
 
Whats Newi in C# 8.0
Whats Newi in C# 8.0Whats Newi in C# 8.0
Whats Newi in C# 8.0
 
Java & advanced java
Java & advanced javaJava & advanced java
Java & advanced java
 

Destacado

Ingles speaking
Ingles speakingIngles speaking
Ingles speaking
gabydq
 
Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!
Abhi Patel
 
MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013
Thuy_Dang
 
Drink The Water English
Drink The Water EnglishDrink The Water English
Drink The Water English
paolobro
 
La desicion mas dificil
La desicion mas dificilLa desicion mas dificil
La desicion mas dificil
gabydq
 

Destacado (20)

20140426 wtm66
20140426 wtm6620140426 wtm66
20140426 wtm66
 
Cumple
CumpleCumple
Cumple
 
Ingles speaking
Ingles speakingIngles speaking
Ingles speaking
 
Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!Seasons of life-Don't judge life in one season!
Seasons of life-Don't judge life in one season!
 
MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013MEET-BIS Vietnam TOR_ ES_2013
MEET-BIS Vietnam TOR_ ES_2013
 
Expo dun and ross
Expo dun and rossExpo dun and ross
Expo dun and ross
 
Jhonatanlopez
JhonatanlopezJhonatanlopez
Jhonatanlopez
 
SEO presentation By Dang HA - ECM team
SEO presentation By Dang HA - ECM teamSEO presentation By Dang HA - ECM team
SEO presentation By Dang HA - ECM team
 
Cumpleaños
CumpleañosCumpleaños
Cumpleaños
 
Lirios do_campo
Lirios do_campoLirios do_campo
Lirios do_campo
 
Coisas antigas 1
Coisas antigas 1Coisas antigas 1
Coisas antigas 1
 
Jhonatanlopez
JhonatanlopezJhonatanlopez
Jhonatanlopez
 
Chromattic usage in eXo Social
Chromattic usage in eXo SocialChromattic usage in eXo Social
Chromattic usage in eXo Social
 
COSTA_CONCORDIA
COSTA_CONCORDIACOSTA_CONCORDIA
COSTA_CONCORDIA
 
Regular expression made by To Minh Hoang - Portal team
Regular expression made by To Minh Hoang - Portal teamRegular expression made by To Minh Hoang - Portal team
Regular expression made by To Minh Hoang - Portal team
 
Cumple2011
Cumple2011Cumple2011
Cumple2011
 
Web accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEAWeb accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEA
 
Drink The Water English
Drink The Water EnglishDrink The Water English
Drink The Water English
 
Mcf presentation by Hai NGUYEN-Portal team
Mcf presentation by Hai NGUYEN-Portal teamMcf presentation by Hai NGUYEN-Portal team
Mcf presentation by Hai NGUYEN-Portal team
 
La desicion mas dificil
La desicion mas dificilLa desicion mas dificil
La desicion mas dificil
 

Similar a Scala - By Luu Thanh Thuy CWI team from eXo Platform SEA

Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lines
lokeshG38
 

Similar a Scala - By Luu Thanh Thuy CWI team from eXo Platform SEA (20)

C#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developersC#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developers
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
1 intro
1 intro1 intro
1 intro
 
Core_Java_Interview.pdf
Core_Java_Interview.pdfCore_Java_Interview.pdf
Core_Java_Interview.pdf
 
Fundamentals of oops in .Net
Fundamentals of oops in .NetFundamentals of oops in .Net
Fundamentals of oops in .Net
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
Polymorphism and interface in vb.net
Polymorphism and interface in vb.netPolymorphism and interface in vb.net
Polymorphism and interface in vb.net
 
Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1
 
C# concepts
C# conceptsC# concepts
C# concepts
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
 
Oopsinphp
OopsinphpOopsinphp
Oopsinphp
 
Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lines
 
Oop
OopOop
Oop
 
Java notes jkuat it
Java notes jkuat itJava notes jkuat it
Java notes jkuat it
 
Java notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esectionJava notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esection
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
 
Java_presesntation.ppt
Java_presesntation.pptJava_presesntation.ppt
Java_presesntation.ppt
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP Introduction
 
OOP Comparative Study
OOP Comparative StudyOOP Comparative Study
OOP Comparative Study
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 

Más de Thuy_Dang (6)

Shell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAShell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEA
 
Secure & authentication By Lai HIEU - eXo SEA
Secure & authentication By Lai HIEU - eXo SEASecure & authentication By Lai HIEU - eXo SEA
Secure & authentication By Lai HIEU - eXo SEA
 
Xss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEAXss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEA
 
Lotus Collaboration by Le Thanh Quang in CT
Lotus Collaboration by Le Thanh Quang in CT Lotus Collaboration by Le Thanh Quang in CT
Lotus Collaboration by Le Thanh Quang in CT
 
Os gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC teamOs gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC team
 
eXo Presentation: Bonita by Nguyen Anh Vu
eXo Presentation: Bonita by Nguyen Anh VueXo Presentation: Bonita by Nguyen Anh Vu
eXo Presentation: Bonita by Nguyen Anh Vu
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Scala - By Luu Thanh Thuy CWI team from eXo Platform SEA

  • 1. Scala a successor to java CWI team
  • 2.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. www.exoplatform.com Copyright 2011 eXo Platform 1 st Unification ADTs are class hierarchies Many functional languages have algebraic data types and pattern matching =>Concise and canonical manipulation of data structure From object-oriented point of view -”ADTs are not extensible” - “ADTs violate the purity of the OO data model” - “Pattern matching breaks encapsulation” => using class hierarchies.
  • 9. www.exoplatform.com Copyright 2011 eXo Platform 1 st Unification ADTs are class hierarchies With class hierarchies contents is encapsulaated in the object and accessed through methods With ADTs : data is accessed through decomposing the value by pattern matching ADTs and class hierarchies have complementary strength and weakness - ADTs allow easy extension of operations supported by the data - While class hierarchies allow easy addition of data variants
  • 10. www.exoplatform.com Copyright 2011 eXo Platform 1 st Unification ADTs are class hierarchies ADTs can be encoded using case classes - Case classes are like normal classes. - Instance constructors can be recovered by pattern matching - Structural equality is used for comparison - The new keyword is optional for instance creation. Case class ClockTime(hour: Int, min:Int) is a valid case class definition. ClockTime(10,30) creates an instance
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. Q & A