Unit 2 Object-Oriented Fundamentals

 

In Unit 1, you have reviewed the basics concepts of object-oriented programming in Scala. In this unit, you’ll keep examining its fundamentals. You’ll implement an SBT executable application to return the current date and time for a given time zone using java.time, one of the internal packages available. In particular, you’ll learn about the following subjects:

  • Lesson 9 demonstrates how to structure your program in logical packages and import internal and external ones into your code.
  • Lesson 10 shows you how to use access modifiers to control the scope of your values, functions, and classes and to prevent your program from exposing sensitive information and unwanted modifications.
  • Lesson 11 illustrates objects as built-in singleton support in the language. You’ll also discover how to implement static methods and new constructors for a given class through its companion object.
  • Lesson 12 introduces traits as a tool to define commonalities between different classes, one of its most popular use cases. You are probably already familiar with this concept: many object-oriented languages refer to it as “interface”.
  • Finally, you’ll apply these concepts and implement an sbt application to return the current time in a given timezone in lesson 13.

Once you have learned how to create an sbt executable application, you’ll continue with Unit 3, in which you’ll see how to implement a simple HTTP server.