JavaAdvanced4 - 5 tháng

Scala

Lộ trình phát triển toàn diện Scala theo tiêu chuẩn quốc tế nilbuild/developer-roadmap

Hướng dẫn từng bước từ nền tảng đến chuyên sâu giúp bạn làm chủ Scala. Tích hợp tài liệu lý thuyết, bài viết thực chiến, video tham khảo và bài tập lập trình trực tiếp trên IDE.

Giai đoạn:5 Phases
Mô-đun:165 Kỹ năng
Thực hành:37 Bài Lab IDE
Tiêu chuẩn:nilbuild/roadmap
⚡ Trình biên dịch IDE trực tuyến: Làm chủ kỹ năng thông qua thực hành viết mã và kiểm thử tự động.
Mở IDE Thực Hành Lộ Trình Này →
Bộ lọc:
Thành thạo:0% (0/0)
01
Giai đoạn 1Xây dựng tư duy kiến trúc và công cụ nền tảng

Nền Tảng & Khái Niệm Cốt Lõi

Giai đoạn 1 tập trung hoàn thiện 33 chủ đề then chốt.

Cốt lõiKiến thức

Akka / Pekko

Akka and Pekko are toolkits for building concurrent, distributed, and resilient applications on the JVM using Scala. Akka, originally developed by Lightbend, introduced an actor model for managing concurrency, inspired by Erlang. It provides abstractions for building scalable and fault-tolerant systems. Pekko is an open-source fork of Akka, created after Akka's licensing changes, and continues to provide similar functionality under the Apache License. Both toolkits support the actor model, which simplifies the development of highly concurrent and distributed applications. They also offer additional modules for HTTP, streaming, clustering, and persistence, making them suitable for a wide range of applications, from microservices to large-scale distributed systems. Resources

Akka/Engineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Akka & Pekko Streams

Akka Streams, now succeeded by Pekko Streams, provide a powerful way to handle streams of data reactively and efficiently. These libraries offer tools to define data processing pipelines with backpressure, ensuring that data flows smoothly between components without overwhelming any part of the system. Think of it as an assembly line for data, where each stage performs a specific operation, and the system as a whole adapts to varying rates of input.

Akka&Engineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Akka

Akka is a suite of modules designed for building scalable, resilient, and distributed systems using the actor model. It simplifies concurrency and fault tolerance by providing a framework for handling asynchronous operations and message passing. Akka is particularly well-suited for developing systems that require high availability and scalability.

AkkaCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Akka HTTP

Akka HTTP is a modern, fast, asynchronous, and streaming-first HTTP server and client. It implements a full server- and client-side HTTP stack on top of akka-actor and akka-stream. Akka HTTP is not a web framework but rather a toolkit for providing and consuming HTTP-based services. It offers a flexible “Routing DSL” for defining RESTful web services and provides functionality for typical web servers, such as deconstructing URIs, content negotiation, and static content serving.

AkkaHTTPEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Anonymous Functions / Lambdas

Anonymous functions, also known as lambdas, are functions without names. You define them inline where you need them, typically to pass them as arguments to other functions. They're essentially a concise way to represent small, single-expression functions. Scala uses a special syntax to define them, making it easy to create functions on the fly.

AnonymousFunctionsEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

The apply method

The apply function is a so-called smart constructor. It's the most popular way in Scala to create new instances of data types. It's more flexible than a standard constructor because it allows for running certain logic before deciding whether an instance should be created, and, if yes, it can create an instance of a certain subtype while returning it as an instance of a supertype.

TheapplyEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

Array

An array is a fixed-size data structure that stores elements of the same data type. Arrays in Scala are mutable, meaning their elements can be updated. Arrays provide fast and constant-time access to elements based on their indices.

ArrayCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Backend

Backend software development in the context of programming in Scala involves creating and maintaining the server-side components of applications that handle business logic, data processing, and communication with databases or other services. Frameworks like Akka, Play, and http4s are commonly used in the Scala ecosystem to build high-performance backend services. These tools leverage Scala's strengths to provide solutions that are both maintainable and capable of handling the demands of modern web applications.

BackendCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Books

Books offer a structured and comprehensive way to learn a new programming language. They typically cover fundamental concepts in detail, building upon previous knowledge to provide a solid understanding. Good books often include examples, exercises, and practice problems that allow you to reinforce what you've learned and apply it to real-world scenarios. They're often curated and reviewed, providing reliable and accurate information.

BooksCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Booleans

Booleans represent truth values: either `true` or `false`. They are fundamental for decision-making in programs, allowing you to control the flow of execution based on conditions. You use booleans with logical operators like `&&` (and), `||` (or), and `!` (not) to create more complex expressions that evaluate to either `true` or `false`. These are often used in conditional statements (like `if` and `else`) and loops.

BooleansCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Build Tools

Build tools automate tasks like compiling code, running tests, and packaging applications. They streamline the development process and ensure consistency across projects. In the Scala ecosystem, popular build tools include `scalacli`, a newer option emphasizing simplicity and speed, `sbt`, a widely used and powerful tool with a large plugin ecosystem, and `mill`, known for its fast builds and reliance on Scala itself for configuration.

BuildToolsEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

By-name parameters

By-name parameters are defined using the => symbol before the parameter type. Such a parameter will be evaluated only when it is used inside the method's body. You can think of it as syntactic sugar over a zero-parameter function passed to a method.

By-nameparametersEngineering
3 khái niệmChi tiết
Cốt lõiIDE Lab

Calico

Calico is a pure, reactive UI library for Scala.js. It enables developers to build reactive web applications using Scala.js, integrating with libraries such as Cats Effect and FS2.

CalicoCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Capabilities

Scala 3 introduces a new feature called "capabilities" as an alternative way to model effects. In short, a capability is an implicit function passed as a parameter. The function that requires a capability as a parameter declares in this way, that it will only work if in its scope is a capability to perform a certain task.

CapabilitiesCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Capture checking

Capture Checking is an experimental feature in Scala that allows you to track which designated values are captured (i.e., stored as references) by arbitrary other values. This tracking happens at compile time and is currently an opt-in mechanism that can be enabled via an import. Capture checking helps ensure resource safety and prevent capability leakage by verifying at compile-time that capabilities (representing resources, effects, or permissions) are properly managed and do not escape their intended scope.

CapturecheckingEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Case classes

Case classes are a special type of class that is particularly useful for modeling immutable data. They provide several conveniences over regular classes, including immutability, several synthetic methods like toString, equals, and copy, as well as synthetic apply and unapply methods, which make case classes very useful for pattern matching.

CaseclassesEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Case Objects

Case objects are similar to regular Scala objects but with additional features that they share with case classes - immutable and with synthetic methods. They are often used for creating singleton objects and are particularly useful in pattern matching and message passing.

CaseObjectsEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Category Theory

Category Theory is a branch of mathematics that deals with structures and relationships between them. In the context of Scala and functional programming, Category Theory provides a framework for understanding and designing functional programs. Key concepts include categories, functors, monads, and natural transformations, which are essential for writing maintainable functional code.

CategoryTheoryEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Cats Effect

Cats Effect is a high-performance, asynchronous, composable framework for building real-world applications in a purely functional style within the Typelevel ecosystem. It provides a concrete tool, known as "the IO monad," for capturing and controlling actions, often referred to as "effects," that your program wishes to perform within a resource-safe, typed context with seamless support for concurrency and coordination. Cats Effect is designed to be fast, reliable, and community-driven, offering strong guarantees and functionality for managing resources, handling concurrency, and ensuring program safety.

CatsEffectEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Cats

Cats provides core abstractions for functional programming in Scala. It aims to be modular, approachable, and efficient, while providing a foundation for an ecosystem of pure, typeful libraries. Cats Effect, a part of the Cats ecosystem, offers a pure asynchronous runtime for Scala, enabling developers to build scalable and resilient applications. The ecosystem includes libraries for streaming frameworks, database layers, HTTP servers and clients, and more. Resources

CatsCoreEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

Chimney

Chimney is a Scala library that provides typeclasses and macros for intuitive and type-safe transformations between data structures. It allows for automatic derivation of transformers between different model case classes, reducing boilerplate code. Chimney uses macros internally to ensure that transformations are checked at compile time, providing safety and convenience.

ChimneyCoreEngineering
1 khái niệmChi tiết
Khuyên họcIDE Lab

Circe

Circe is a JSON library for Scala that is part of the Cats ecosystem. It provides a functional way to handle JSON data, including encoding and decoding using Encoder and Decoder type classes. Circe aims to simplify working with JSON by hiding implementation details in a simple API and offers good performance and complete documentation.

CirceCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Class

A class is a blueprint for creating objects. Classes can contain methods, values, variables, types, objects, and traits. The primary constructor is defined in the class signature. Classes are defined using the class keyword followed by the class name.

ClassCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

collect / collectFirst

The collect and collectFirst methods are used to apply a partial function to elements of a collection. The collect method takes a partial function as its parameter and applies it to all the elements in the collection to create a new collection. The new collection contains only those elements that were successfully mapped by the partial function. The collectFirst method applies the partial function to the first element in the collection for which the function is defined and returns its result wrapped with Some, or None if the function is not defined for any element in the collection.

collect/Engineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Concurrency

Next to backend software development, concurrent programming is the other niche where Scala shines. Scala offers a number of solutions from all over the board: effect systems, actors, and so-called direct style.

ConcurrencyCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Conditionals

Conditional statements are primarily handled using if/else and match/case constructs. The if/else construct is straightforward and similar to other programming languages, allowing for simple conditional branching. The match/case construct is more powerful and can handle multiple conditions, pattern matching, and even include guards (additional conditions using if expressions within each case). Resources

ConditionalsCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Context bounds

Context Bounds in Scala is a feature that provides a shorthand syntax for expressing the common pattern of a context parameter that depends on a type parameter. Context bounds are used to simplify the code for generic types and are particularly useful in the context of type classes.

ContextboundsEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Conversions

Implicit conversions allow the compiler to automatically convert one type to another in certain situations. In Scala 3, implicit conversions are defined by a given instance of type scala.Conversion\[S, T\], where S is the source type and T is the target type. In Scala 3.8+, the into keyword is used to mark types that can be implicitly converted. If the expected type of an expression is into\[T\], then an implicit conversion to that type can be inserted without the need for a language import.

ConversionsCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

CosPlay

CosPlay is a 2D ASCII game engine for Scala. It is designed to be a standard Scala3-based program with minimal requirements for code organization. CosPlay allows for the creation of games using ASCII characters and provides methods to initialize the game engine, start the game loop, and dispose of the game engine when the game exits.

CosPlayCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Courses

Courses offer a structured learning path, typically designed by experts, that guides you through the fundamentals to advanced concepts. They often include hands-on exercises, projects, and assessments to reinforce learning and provide practical experience. Courses come in various formats, like online videos, interactive tutorials, and in-person workshops, catering to different learning preferences and schedules. They can be a great way to stay motivated, track your progress, and gain a recognized credential upon completion.

CoursesCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Data Handling

Data handling involves the processes of gathering, storing, and manipulating data for various purposes. It encompasses activities like reading data from different sources, transforming it into a usable format, and performing operations to analyze or modify it. Efficient data handling is essential for building applications that can process and utilize information effectively.

DataHandlingEngineering
2 khái niệmChi tiết
Khuyên họcIDE Lab

Data Structures: Class, Trait, and Object

Scala provides three fundamental building blocks for structuring data and behavior: classes, traits, and objects. A class is a blueprint for creating objects, encapsulating data (fields) and behavior (methods). A trait is similar to an interface but can also contain concrete methods and fields, allowing for code reuse through mixins. An object is a singleton instance of a class, useful for creating utility classes or entry points to applications. Together, these structures enable the creation of well-organized and maintainable code.

DataStructures:Engineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Distributed computing

Distributed computing involves creating systems where multiple computers work together to solve complex problems by sharing resources and processing tasks across a network. Scala is particularly well-suited for distributed computing due to its ecosystem of libraries and frameworks like Akka, Apache Spark, and ZIO, which provide tools for building resilient, scalable, and fault-tolerant distributed systems.

DistributedcomputingEngineering
3 khái niệmChi tiết
02
Giai đoạn 2Làm chủ các thư viện, framework và luồng xử lý chính

Kỹ Năng Trọng Tâm & Thực Hành

Giai đoạn 2 tập trung hoàn thiện 33 chủ đề then chốt.

Cốt lõiKiến thức

Docs

Scala's official documentation is a fantastic place to start learning the language and its features. It provides comprehensive guides, tutorials, and API references that cover everything from basic syntax to advanced concepts. You can find clear explanations, practical examples, and detailed descriptions, making it easy to understand how different parts of Scala work and how to use them effectively.

DocsCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Doobie

Doobie is a pure functional JDBC layer for Scala and Cats. It provides a functional way to construct programs and higher-level libraries that use JDBC. Doobie is designed to be type-safe and composable, allowing developers to write database interactions in a purely functional style.

DoobieCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Early returns

This topic brings together several concepts you have already encountered: pattern matching, partial functions, the apply and unapply methods, and lazy collections. Its purpose is to let you see how they work together.

EarlyreturnsEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Know your ecosystem

Ecosystems in Scala are groups of frameworks and libraries that work well together and are often maintained and developed by the same organization. While nothing is stopping you from choosing any framework or library from the wide spectrum of Scala open-source projects, it often makes sense to stick to those that belong to the same ecosystem unless you have a good reason to pick another. Of course, you’re also free to use one ecosystem in one project and another in a different project.

KnowyourEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Effect systems

An effect system is a programming paradigm that helps manage side effects in a controlled and predictable manner. In functional programming, side effects - such as input/output operations, state changes, or exceptions - can introduce complexity and make code harder to reason about. An effect system allows developers to explicitly declare and handle these side effects, making the code more modular, testable, and maintainable. By separating the description of what a program should do from the actual execution of those actions, effect systems enable better composition and reasoning about program behavior.

EffectsystemsEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Either

The Either class in Scala is used to represent a value of one of two possible types (a disjoint union). An instance of Either is either an instance of scala.util.Left or scala.util.Right.

EitherCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Emacs

Emacs is a highly extensible and customizable text editor known for its features and flexibility. When equipped with the Metals plugin, Emacs becomes a robust environment for Scala development, offering features like code completion, refactoring, and debugging.

EmacsCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Enums

In Scala 3, enums are used to define a type consisting of a set of named values. They provide a more concise and safer way to define enumerations compared to the traditional Enumeration class in Scala 2.

EnumsCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Error handling

Scala offers multiple ways to handle errors, including try/catch/finally blocks, Option, Either, and Try. These methods allow developers to handle exceptions and errors in a functional and composable way.

ErrorhandlingEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Filter

The `filter` method in Scala collections lets you pick out the elements you want based on a condition. You give it a function that takes an element and returns `true` if you want to keep it, and `false` if you want to discard it. The `filter` method then returns a new collection containing only the elements for which the function returned `true`.

FilterCoreEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

find

The `find` method is used on collections (like Lists, Sets, or Maps) to locate the first element that satisfies a given condition. You provide `find` with a function that checks each element, and if the function returns `true` for an element, `find` immediately returns `Some(element)`. If no element matches the condition, it returns `None`. Think of it as a targeted search that stops as soon as it finds a match.

findCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

flatMap

The flatMap method is used to apply a function to each element of a collection and then flatten the results into a new collection. It is essentially a combination of the map method followed by the flatten method, but this seemingly very simple property makes it fundamental for Functional Programming.

flatMapCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Float

Floats in Scala are used to represent numbers with decimal points. They are like regular numbers but can have a fractional part, such as 3.14 or -2.7. A float uses 32 bits of memory and can store values with a certain level of precision. Because they are stored in binary format with a limited number of bits, they can sometimes have slight inaccuracies when representing certain decimal numbers.

FloatCoreEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

foldLeft

The foldLeft method is used to produce a single result by "folding" all the elements of a collection. The algorithm starts with a "zero" element which is paired with the first element of the collection to create an intermediate result element. Then that intermediate result is paired with the second element of the collection to create a new intermediate result, and so on, until the algorithm reaches the end of the collection. Then the final result is returned.

foldLeftCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

for-comprehensions

For-comprehensions in Scala are used to evaluate expressions and return a sequence of values. They have the form for (enumerators) yield e, where enumerators refer to a list of enumerators. They are basically syntax sugar over flatMap but they help a lot in making your code both safe and.

for-comprehensionsCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

foreach

The foreach method is used to apply a function to each element of a collection for its side effects. Unlike methods like map or filter, foreach does not return a value; it is used primarily for operations that have side effects, such as printing elements or modifying external state.

foreachCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

FS2

FS2 is a library for purely functional, effectful, and polymorphic stream processing in the Scala programming language. Its design goals are compositionality, expressiveness, resource safety, and speed. FS2 is built upon Cats and Cats-Effect, and its core types (streams and pulls) are polymorphic in the effect type, allowing it to be used with other effect libraries.

FS2CoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Functions returning functions

In Scala, functions can return other functions. Currying is the process of converting a function with multiple arguments into a sequence of functions that take one argument each. Function composition is the process of combining two or more functions to create a new function. Resources

FunctionsreturningEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Functions & Methods

Functions and methods are fundamental building blocks for organizing and reusing code. A function is essentially a block of code that performs a specific task. You give it some input (arguments), and it returns an output (return value). A method is very similar to a function, but it's associated with an object or class. It operates on the data within that object or class. In practice, the distinction between functions and methods in Scala is often blurred, but the key is they both allow you to break down complex problems into smaller, manageable pieces.

Functions&Engineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

Gatling

Gatling is an open-source tool for performance and load testing, particularly well-suited for testing web applications. It is built on Scala, Akka, and Netty, and allows you to write test scenarios using expressive SDKs in Scala, Java, Kotlin, JavaScript, or TypeScript. Gatling is designed to be high-performance and can simulate thousands of concurrent users with minimal system resources. It provides detailed reports and integrates well with CI/CD pipelines.

GatlingCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Gears

Gears is an experimental asynchronous programming library for Scala 3. It is designed to enable direct-style programming, structured concurrency, and is cross-platform, working on both JVM >=21 and Scala Native. Gears provides a simple and structured way to handle concurrent programming, minimizing computation leaks and offering tools for dealing with external, unstructured events.

GearsCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

GraalVM Native Image

GraalVM Native Image is a tool that compiles Java applications into native binary executables using ahead-of-time (AOT) compilation. When used with Scala, it can significantly improve the performance and startup time of Scala applications by eliminating the need for a JVM at runtime. The process involves using plugins like sbt-native-image, which automates the installation of GraalVM and the generation of native binaries. However, configuring GraalVM for Scala applications can be challenging due to the need to handle reflection and other dynamic features used by Scala libraries.

GraalVMNativeEngineering
3 khái niệmChi tiết
Cốt lõiIDE Lab

Gradle

Gradle is widely used for building, testing, publishing, and deploying software packages. It is known for its flexibility and efficiency in managing dependencies and resolving version conflicts. Gradle uses a Groovy-based Domain Specific Language (DSL) for writing build scripts, making it more flexible and readable compared to XML-based build tools like Maven. Gradle supports incremental builds and build caching, which can significantly speed up the build process. It is commonly used for Java, Kotlin, and Android projects but can also be used for Scala. Resources

GradleCoreEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

GUI Frameworks and Libraries

GUI frameworks and libraries provide tools and components for creating graphical user interfaces in applications. These tools handle the visual elements like windows, buttons, text fields, and other interactive elements, along with event handling to make applications responsive to user actions. They allow developers to build desktop or web-based applications with a rich, interactive visual experience.

GUIFrameworksEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

http4s

bb http4s is a minimal, idiomatic Scala interface for HTTP services. It is built on FS2, a streaming library that allows for processing and emitting large payloads in constant space and implementing websockets. http4s is designed to be composable and easy to reason about, with I/O managed through cats-effect.

http4sCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Implicit parameters

Implicit parameters are passed to functions without having to explicitly specify them at the call site. This can make your code more concise and readable, especially when dealing with common or boilerplate code. In Scala 2, they were declared with the implicit keyword. In Scala 3, we use keywords given and using. The given keyword is used to define instances of implicit values, and the using keyword is used to declare context parameters.

ImplicitparametersEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Indigo

Indigo is a game engine written in Scala, designed specifically for functional programmers. It aims to address challenges in testing games and managing data flow and state. Indigo supports Scala 3.0 and is particularly suited for developing 2D pixel art games.

IndigoCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Integers

Integers are whole numbers, meaning they don't have any fractional or decimal parts. In Scala, integers can be positive (like 5), negative (like -10), or zero (0). They are used for counting and performing arithmetic calculations that involve only whole numbers. Scala provides several integer types, each with a different range of values they can represent, allowing you to choose the most appropriate type based on the size of the numbers you need to work with.

IntegersCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

IntelliJ IDEA

IntelliJ IDEA is a popular integrated development environment (IDE) that offers support for Scala through its Scala Plugin. This plugin provides essential features for Scala development, including code completion, refactoring, debugging, and seamless integration with build tools like sbt and Maven.

IntelliJIDEAEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

Introduction

Scala is a programming language that blends object-oriented and functional programming ideas. It runs on the Java Virtual Machine (JVM) and can also be compiled to JavaScript. This makes it possible to use Scala for a wide variety of tasks, from building large-scale systems to writing web applications and scripts. It is designed to be concise, elegant, and type-safe, aiming to provide developers with powerful tools for creating robust and scalable applications.

IntroductionCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Iterators

An iterator is a mechanism to access a collection's elements sequentially in a performant way. They are often used in loops. On the other hand, they are mutable, and careless use can lead to non-trivial bugs.

IteratorsCoreEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

JavaFX

JavaFX is a GUI toolkit for Java designed to create rich desktop applications with modern user interfaces. It provides a comprehensive set of UI controls, supports hardware-accelerated graphics, and can be used to build applications that run across multiple platforms, including web, desktop, and mobile. JavaFX is known for its ease of use and integration with Java libraries.

JavaFXCoreEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

Jsoniter

Jsoniter is a library for compile-time generation of safe and ultra-fast JSON codecs for Scala. It uses Scala macros to generate codecs and has its own core mechanics for parsing and serialization. Jsoniter is designed to provide high performance and efficient processing of JSON data, making it suitable for handling both small JSON messages and large JSON data sets.

JsoniterCoreEngineering
2 khái niệmChi tiết
03
Giai đoạn 3Kỹ thuật chuyên sâu, hiệu năng và chuẩn thiết kế

Kiến Trúc Nâng Cao & Tối Ưu

Giai đoạn 3 tập trung hoàn thiện 33 chủ đề then chốt.

Cốt lõiKiến thức

JUnit

JUnit is a popular open-source unit testing framework for Java. It is part of the xUnit family and is designed to help developers write and run repeatable tests. JUnit is widely used for unit testing and supports various types of tests, including integration tests. It is trusted by millions of developers worldwide and is known for its simplicity and effectiveness in ensuring code quality.

JUnitCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

JVM

Scala's primary platform is the Java Virtual Machine (JVM). Scala code is compiled into Java bytecode, allowing it to run on any device with a JVM, independent of the underlying machine configuration. This setup ensures compatibility with Java libraries and tools, making Scala a versatile choice for developers familiar with the Java ecosystem. The JVM's backward compatibility ensures that Scala code compiled on older versions can run on newer JVMs without issues.

JVMCoreEngineering
1 khái niệmChi tiết
Cốt lõiIDE Lab

Kyo

Kyo is a toolkit for Scala development, providing a rich standard library for development across Native, JVM, and JavaScript platforms. It introduces a novel approach based on algebraic effects to deliver straightforward APIs in the pure Functional Programming paradigm.

KyoCoreEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

Laminar

Laminar is a UI library for Scala.js that focuses on simplicity, expressiveness, and safety. It allows developers to build web application interfaces while keeping the UI state in sync with the underlying application state.

LaminarCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Laziness

Laziness is a feature that allows you to defer the evaluation of an expression until it is needed. This can be useful for optimizing performance and avoiding unnecessary computations.

LazinessCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Lazy collections

Lazy collections are used to describe successive transformation operations without evaluating intermediate transformations. They are particularly useful for creating infinite collections without blowing the memory.

LazycollectionsEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Lazy vals

Lazy vals are used to defer the initialization of a variable until it is accessed for the first time. This can be useful for optimizing performance and avoiding unnecessary computations.

LazyvalsEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

LazyList

A lazy list is an immutable linked list that computes its elements only when they are needed. Elements are memoized, meaning the value of each element is computed at most once.

LazyListCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Li Haoyi

The Li Haoyi ecosystem is centered around making Scala easy to use and productive. It includes libraries like Ammonite REPL, Mill Build Tool, os-lib, uPickle, Cask, and Scalatags. This ecosystem emphasizes executable pseudocode, ease of use, and productivity. It is designed to allow developers to write Scala in a way that is easy and productive, delivering real business value. The ecosystem is maintained by Li Haoyi and is known for its simplicity and practicality.

LiHaoyiEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

LibGDX with Scala

LibGDX is a popular JVM framework for game design that can be used with Scala. It provides a set of tools for creating cross-platform games. Scala developers can use LibGDX with build tools like sbt or Gradle to manage their projects. LibGDX supports various features such as graphics, sound, physics emulation, and more, making it a versatile choice for game development.

LibGDXwithEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

List

Lists are ordered, immutable collections of elements of the same type. Once a list is created, you can't change its elements directly; instead, you create a new list with the desired modifications. They're useful for storing sequences of items where the order matters, like a to-do list or a series of events. Common operations include adding elements to the beginning of the list (using `::`), accessing elements by index, and iterating through the list.

ListCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Loops

Loops are used to execute a block of code repeatedly. Scala supports the following types of loops. **while loop**: Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body. **for loop**: Used to iterate over collections or ranges. It is often used for its readability and conciseness. **do-while loop**: Deprecated in Scala 3. Similar to the while loop, but the condition is tested at the end of the loop body, ensuring that the loop body is executed at least once.

LoopsCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Macros & the Type System

Macros are pieces of code that transform other code at compile time. They allow you to perform computations and generate code based on the structure of your program, enabling powerful metaprogramming capabilities. The type system, on the other hand, is a set of rules that govern how data types are used in a programming language. It ensures type safety, preventing errors by verifying that operations are performed on compatible data types during compilation.

Macros&Engineering
2 khái niệmChi tiết
Khuyên họcIDE Lab

Macros

Macros enable advanced metaprogramming capabilities, such as code generation, optimizations, and the creation of domain-specific languages (DSLs). Scala 3 macros were redesigned to be more intuitive and flexible than the previous version.

MacrosCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Magnolia

Magnolia is a generic macro for automatic materialization of typeclasses for datatypes composed from case classes (products) and sealed traits (coproducts). It supports recursively-defined datatypes out-of-the-box and incurs no significant time penalty during compilation. Magnolia provides a simple interface for handling products and coproducts, which is then used by the Magnolia macro to derive typeclasses automatically.

MagnoliaCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Map

A Map is a collection that holds key-value pairs. Think of it like a dictionary where each key is associated with a specific value. Keys are unique within a map, and you use a key to quickly retrieve its corresponding value. Maps are useful for storing and accessing data based on a unique identifier.

MapCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

map

The map method is used to apply a function to each element of a collection and create a new collection with the same number of elements, where each element is the result of applying that function to the original element. Resources

mapCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Maven

Maven is a build automation and dependency management tool primarily used for Java projects. It simplifies the build process by using a Project Object Model (POM) file, typically named pom.xml, which centralizes project configuration and manages dependencies. Maven follows best practices and conventions to ensure consistent project setups, making it easier for developers to understand and manage projects. It integrates well with other tools like IDEs (Eclipse, IntelliJ IDEA) and version control systems (Git). Maven's key features include dependency management, build automation, and a large repository of libraries and metadata.

MavenCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Method calls

Method calls can be made using different syntaxes and conventions. Methods can be called using the standard dot notation (e.g., obj.method(params)) or using the infix notation (e.g., obj method params). Scala also allows the omission of parentheses on methods of arity-0 (no arguments), but this syntax should only be used when the method in question has no side effects. Additionally, Scala supports named parameters, which can be used to make method calls more readable.

MethodcallsEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Mill

Mill is a build tool designed for Java, Scala, and Kotlin projects. It focuses on speed and efficiency by automatically caching and parallelizing build tasks and tests. Mill uses a long-lived daemon to keep the JVM warm, which helps in maintaining fast build times. It also supports selective test execution to shorten CI times. Mill is designed to be simple and intuitive, making it a good choice for both small and medium-sized projects.

MillCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Monads

Monads in Scala are constructs that augment a value with additional features, known as effects. These effects can include managing the nullability of a variable or handling the asynchronicity of its computation. In Scala, common monads include Option\[T\], Future\[T\], Either, List, and more. A monad adds an effect to a value by wrapping it around a context. The key functions a monad must implement are unit (which lifts a value into the monadic context) and flatMap (which allows for chaining operations within the monadic context).

MonadsCoreEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

Monocle

Monocle is an optics library for Scala and Scala.js, strongly inspired by Haskell Lens. It provides functionalities for creating and manipulating lenses, prisms, and isomorphisms. Monocle uses macros to simplify the generation of optics, such as lenses for case classes, prisms for subclasses, and isomorphisms between types. This makes it easier to work with nested data structures and perform operations like accessing, modifying, and transforming data in a concise and type-safe manner.

MonocleCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

mUnit

MUnit is a Scala testing library that offers actionable errors and extensible APIs. It is designed to provide clear and helpful error messages when tests fail, making it easier to debug and fix issues. MUnit allows you to run test suites directly from your IDE, whether it's IntelliJ, VS Code, or any other LSP editor.

mUnitCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Mutable collections

Mutable collections are used when you need collections that can be updated or extended in place, usually for better performance. After the computations are done, you can transform it to its immutable counterpart. Scala provides several mutable collection classes, including ArrayBuffer, ListBuffer, HashSet, and HashMap. Resources

MutablecollectionsEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

No ecosystem

The Scala open-source landscape outside of the major ecosystems often focuses on niche use cases or innovative ideas that may not be covered by the larger frameworks. Projects in this space can range from specialized tools for data science, machine learning, and web development to unique solutions for testing, build management, and database connectivity. These projects are frequently driven by individual developers or small communities.

NoecosystemEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Nothing

`Nothing` is a special type in Scala that sits at the bottom of the type hierarchy. It's a subtype of every other type, meaning it can be used anywhere any other type is expected. However, `Nothing` has no instances (no actual values), which essentially means that a function returning `Nothing` will never return normally; it either throws an exception, enters an infinite loop, or the program exits. You can think of it as a "dead end" type that signals a point of no return in your code.

NothingCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Object

The object keyword is used to create a singleton object. A singleton object is a class that has only one instance. Singleton objects are often used to define methods and values that are not specific to instances of a class, similar to static methods in Java.

ObjectCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Standard operators

Operators are methods that can be used in a more readable and intuitive way. Scala supports standard arithmetic operators (+, -, \*, /), relational operators (==, !=, >, <, >=, <=), and logical operators (&&, ||, !). Additionally, Scala has specific operators like the arrow (->) and fat arrow (=>). The arrow operator (->) is used to create tuples, which are pairs of values. For example, 1 -> 2 creates a tuple (1, 2). The fat arrow (=>) is used in function definitions and pattern matching. Resources

StandardoperatorsEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Option

The Option class in Scala is used to represent optional values. It is a carrier of single or no element for a stated type, and is particularly useful for handling cases where a value might be null.

OptionCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Ox

Ox is a Scala library designed for safe direct-style streaming, concurrency, and resiliency on the JVM. It offers a comprehensive set of tools for managing concurrency, error handling, and resource management in a developer-friendly manner. Ox leverages Scala 3 and JDK 21+ to provide structured concurrency, high-level concurrency operators, and safe low-level primitives. It also includes features for error management, such as retries, timeouts, and safe error propagation.

OxCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

package

The package keyword is used to create namespaces that can contain entities such as classes, objects, and other packages. In Scala 2, package objects allow defining functions, variables, and types that are accessible to all members of a package. In Scala 3, it's possible to define all those elements at the top-level, so there is no longer any need to declare package objects.

packageCoreEngineering
1 khái niệmChi tiết
Khuyên họcIDE Lab

Pattern Matching

Pattern matching is a way to check a value against a set of patterns. Think of it like a more powerful `switch` statement. You provide a value and then define different "cases" or patterns that the value might match. When a match is found, the code associated with that pattern is executed. It's often used to deconstruct data structures or identify specific conditions within your code.

PatternMatchingEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Pekko

Pekko is an open-source framework for building applications that are concurrent, distributed, resilient, and elastic. It uses the Actor Model to provide intuitive high-level abstractions for concurrency. Pekko is a fork of Akka 2.6.x and offers libraries for persistence, streams, HTTP, and more.

PekkoCoreEngineering
3 khái niệmChi tiết
04
Giai đoạn 4Kiểm thử, CI/CD, đám mây và quy chuẩn sản xuất

Hệ Sinh Thái & Triển Khai Thực Tế

Giai đoạn 4 tập trung hoàn thiện 33 chủ đề then chốt.

Cốt lõiIDE Lab

Know your platform

A platform is a runtime environment in which code is compiled and executed. Scala is primarily known as a JVM language, alongside Java and Kotlin. Scala code is compiled into the same bytecode as these languages and runs in the Java Runtime Environment (JRE), which provides independence from specific machine configurations and features such as garbage collection. However, there are at least two other platforms where Scala code can be run: Scala Native, which aims to compile Scala directly to machine code, bypassing the JRE, and Scala.js, which transpiles Scala code to JavaScript, allowing it to run in web browsers.

KnowyourEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Play

The Play Framework is an open-source web application framework that follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, such as Java. Play is designed to optimize developer productivity by providing a lightweight, stateless, web-friendly architecture that uses Akka and Akka Streams to ensure predictable and minimal resource consumption (CPU, memory, threads) for highly scalable applications. It is particularly well-suited for building modern web applications and REST services.

PlayCoreEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

PlayJSON

PlayJSON is a Scala JSON library originally developed for use with Play Framework. It uses Jackson for JSON parsing and offers features like custom validation while parsing and automatic parsing of JSON in request bodies.

PlayJSONCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

private / protected

The private and protected keywords are used to control the visibility of members (variables and methods) in classes, objects, or packages. If no access modifier is specified, the default access level is public.

private/Engineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Pure functions

Pure functions in Scala are functions that always return the same output for the same input and do not have any side effects. They are fundamental to functional programming and provide predictability and reliability.

PurefunctionsEngineering
1 khái niệmChi tiết
Khuyên họcIDE Lab

Quill

Quill is a library for database access in Scala that provides a Quoted Domain Specific Language (QDSL) to express queries in Scala and execute them in a target language. It supports compile-time query generation and validation, making it easier to write type-safe and efficient database queries. Quill is designed to minimize boilerplate and support multiple target languages, including SQL and Cassandra Query Language (CQL).

QuillCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Range

A `Range` in Scala represents an ordered sequence of integers (or other numeric types) with a consistent step size. You define a range by specifying its start, end (inclusive or exclusive), and the increment between elements. Ranges are memory-efficient because they don't store all the numbers; instead, they calculate each element on demand, making them ideal for iterating over large sequences or generating arithmetic progressions without the overhead of storing every single value.

RangeCoreEngineering
2 khái niệmChi tiết
Khuyên họcIDE Lab

React.js

React.js is a popular JavaScript library for building user interfaces, developed and maintained by Facebook. It can be integrated with Scala.js, allowing developers to write React applications using Scala.

React.jsCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Recursion basics

Recursion is a fundamental concept in computer science and mathematics where a function or process calls itself as part of its execution. This approach is particularly useful for tasks that can be defined in terms of similar subtasks, such as traversing tree structures, calculating factorials, or solving problems that exhibit self-similarity. In Scala, recursion is supported on many levels. It is possible for a function to recursively call itself. Additionally, the Scala compiler uses tail recursion to rewrite a subset of recursive functions into flat loops, and the Scala standard library contains "trampolines" - a mechanism to simulate recursion without the risk of stack overflow. On top of that, Scala pattern matching helps to write recursive functions in a readable way, and implicit parameters help to keep the code concise.

RecursionbasicsEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Referential Transparency

Referential transparency is a fundamental concept in functional programming where an expression can be replaced by its value without changing the behavior of the program. In Scala, this concept is closely tied to pure functions, which always return the same output for the same input and do not have any side effects.

ReferentialTransparencyEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Regex

Regular expressions are supported through the Regex class in the scala.util.matching package. Regular expressions (regex) are patterns used to match character combinations in strings. They are useful for text processing, pattern matching, and data validation. Resources

RegexCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

sbt

sbt (Scala Build Tool) is a build tool designed for Scala and Java projects. It allows developers to define tasks in Scala and run them in parallel from an interactive shell. sbt is known for its incremental compilation feature, which updates only the parts of the project that have changed, saving time and improving efficiency. It supports a wide range of plugins for tasks like packaging, releasing, and deploying software. sbt is highly configurable and extensible, making it suitable for projects of all sizes, from small applications to large, complex systems.

sbtCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Scala Android Plugin

The Scala Android Plugin is a tool that allows developers to build Android applications using the Scala programming language. It integrates with the Android build system, enabling you to write your application logic, activities, and UI components in Scala, and then compile them into Dalvik bytecode that can run on Android devices. The plugin handles the necessary steps for compiling Scala code, packaging it with Android resources, and creating the final APK file.

ScalaAndroidEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Scala Native

Scala Native is an optimizing ahead-of-time compiler and lightweight managed runtime designed specifically for Scala. By leveraging LLVM, Scala Native compiles Scala code directly to native executables, eliminating the need for a Java Virtual Machine (JVM). This results in faster startup times and smaller memory footprints, making it suitable for environments where performance and resource efficiency are critical. Scala Native also offers interoperability with C libraries, allowing developers to integrate with existing native libraries seamlessly. The compilation process involves converting Scala code to an intermediate format called Native Intermediate Representation (NIR), which is then transformed into an LLVM IR file for execution. The project is supported by the École polytechnique fédérale de Lausanne (EPFL) and has a growing community of contributors.

ScalaNativeEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Scala on Android

This is a repo for examples, small tutorials, and some chaotic notes on how to write Android apps with GraalVM, Gluon Mobile, JavaFX, and Scala.

ScalaonEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

ScalaCLI

ScalaCLI is a command-line tool designed to simplify the process of learning and using Scala. It is optimized for speed and ease of use, making it ideal for scripts, playgrounds, and single-module projects. ScalaCLI manages its own dependencies and supports features like incremental compilation and dependency resolution. It does not require a configuration file, and all configurations can be provided through directives embedded in Scala files or via command-line arguments. Resources

ScalaCLICoreEngineering
3 khái niệmChi tiết
Cốt lõiIDE Lab

ScalaFX

ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX. Every ScalaFX application is also a valid Scala application. It supports full interoperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX are supported. ScalaFX uses a simple, hierarchical pattern for creating new objects and building up the scene graph. Here is a simple, complete application example that creates a new stage (window) with a rectangle that changes color based on mouse events.

ScalaFXCoreEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

Scala.js

Scala.js is a Scala compiler that compiles Scala code to JavaScript, enabling Scala programs to run in web browsers or Node.js. It optimizes Scala code into highly efficient JavaScript, ensuring fast turnaround times with incremental compilation. Scala.js provides strong typing, which catches typos and type errors immediately, making the development process more reliable and efficient. It also offers seamless interoperability with JavaScript libraries, allowing developers to use popular libraries like React and AngularJS directly from their Scala.js code. This makes it easier to leverage existing JavaScript ecosystems while benefiting from Scala's type system and tooling. Additionally, Scala.js supports full-stack development by allowing code to be shared between the frontend and backend, ensuring consistency and reducing the risk of mismatches.

Scala.jsCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Scalameta

Scalameta is a metaprogramming tool for Scala that provides high-quality syntactic and semantic analysis and code generation. It was widely used in Scala 2 for advanced metaprogramming scenarios and continues to be relevant in Scala 3. Scalameta operates at the meta level, taking programs as input and producing syntactic or semantic information or rewritten programs as output. It supports annotation macros and is designed to be more reasonable and debuggable compared to traditional macros.

ScalametaCoreEngineering
2 khái niệmChi tiết
Khuyên họcIDE Lab

ScalaTest

ScalaTest is a flexible and comprehensive testing framework for Scala. It integrates with various tools like JUnit, TestNG, Ant, Maven, sbt, ScalaCheck, and mocking frameworks such as Mockito and ScalaMock. ScalaTest allows you to choose from multiple testing styles, such as FlatSpec, FunSuite, and FunSpec, to fit your team's preferences and project requirements. It is widely used for testing Scala, Scala.js, Scala Native, Dotty (Scala 3), and Java code.

ScalaTestCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

ScalaTest

ScalaTest is a versatile testing framework for Scala that helps programmers write both integration and performance tests. For integration testing, ScalaTest allows you to test the interactions between different components of your application, such as APIs, databases, or services, ensuring they work together as expected. You can use ScalaTest with mocking libraries like ScalaMock to simulate external dependencies, making it easier to isolate and test specific parts of your system. For performance testing, while ScalaTest itself isn't designed for benchmarking, you can use it to verify that your code meets performance requirements by measuring execution times and validating response times.

ScalaTestCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Scalatra

Scalatra is a lightweight, Sinatra-like web framework for Scala. It is designed to be simple, accessible, and easy to use, making it a practical way to learn Scala and build high-performance websites and APIs.

ScalatraCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

ScalikeJDBC

ScalikeJDBC is a tidy SQL-based database access library for Scala developers. It naturally wraps JDBC APIs and provides easy-to-use APIs, making it intuitive and highly flexible. ScalikeJDBC is designed to be practical and production-ready, offering features like QueryDSL for type-safe and reusable code.

ScalikeJDBCCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Scope & Visibility

Scope and visibility in Scala determine where variables, methods, and classes can be accessed within your code. Scope defines the region of code where a variable is valid and accessible, while visibility controls whether a member (variable or method) of a class or object can be accessed from outside that class or object. Understanding these concepts is crucial for writing well-structured, maintainable, and secure Scala programs.

Scope&Engineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Sealed traits

Sealed traits are used to define closed hierarchies where all possible subclasses are known. They can be extended only in the same file as their declaration, allowing the compiler to perform exhaustiveness checking. This feature is particularly useful for pattern matching.

SealedtraitsEngineering
2 khái niệmChi tiết
Khuyên họcIDE Lab

Seq

A `Seq` in Scala represents an ordered collection of elements. Think of it like a list where the order in which you add items matters. You can access elements by their position (index), and `Seq` offers a variety of methods for manipulating the sequence, such as adding, removing, and searching for items. It's a fundamental data structure in Scala for working with ordered data.

SeqCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Set

A Set in Scala is a collection that holds unique elements. This means no duplicates are allowed. Sets are useful when you need to ensure that each item is only present once, like a group of unique user IDs or distinct product names. Scala provides both mutable and immutable Set implementations, allowing you to choose the behavior that best fits your needs.

SetCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Setting Up Scala

Setting up Scala involves installing the Scala compiler and build tools on your system. This allows you to write, compile, and run Scala programs. Typically, this includes downloading the Scala SDK, which contains the compiler and essential libraries, and often using a build tool like sbt (Simple Build Tool) to manage dependencies and build projects. The setup also frequently involves configuring your Integrated Development Environment (IDE) for Scala development, providing features like code completion and debugging.

SettingUpEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

Shapeless

Shapeless is a library for type-level programming in Scala, providing functionalities for generic programming using type classes and macros. It allows for type-safe manipulation and transformation of data structures at compile time, leveraging Scala's type system. Shapeless is known for its use of HLists (heterogeneous lists) and support for type-level computations, making it a cornerstone of advanced type-level programming in Scala.

ShapelessCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Slick

Slick is a Functional Relational Mapping (FRM) library for Scala that allows developers to query and access databases in a manner similar to working with Scala collections. It provides compile-time safety and composability, making it easier to write and maintain database queries. Slick supports various databases like PostgreSQL, MySQL, Oracle, and MS SQL Server, and offers both asynchronous and streaming APIs for efficient database interactions.

SlickCoreEngineering
1 khái niệmChi tiết
Cốt lõiIDE Lab

Slinky

Slinky is a framework for writing React apps in Scala, providing an experience similar to using ES6. It allows developers to leverage Scala's type safety and functional programming features while building React applications. Slinky supports React DOM, React Native, and other React-based platforms.

SlinkyCoreEngineering
2 khái niệmChi tiết
Khuyên họcIDE Lab

Spark

Apache Spark is a framework for big data processing that integrates seamlessly with Scala. It provides a unified engine for various data processing tasks, including batch processing, interactive queries, streaming, machine learning, and graph processing.

SparkCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

specs2

specs2 is a library for writing executable software specifications in Scala. It allows you to write specifications for individual classes (unit specifications) or entire systems (acceptance specifications). specs2 is designed to work with SBT and integrates with various testing styles and frameworks.

specs2CoreEngineering
2 khái niệmChi tiết
05
Giai đoạn 5Các giải pháp quy mô lớn và tư duy dẫn dắt kỹ thuật

Chuyên Gia & Mở Rộng Hệ Thống

Giai đoạn 5 tập trung hoàn thiện 33 chủ đề then chốt.

Cốt lõiIDE Lab

Strings

Strings represent sequences of characters. They're used to store and manipulate text. You create them by enclosing characters within double quotes, like `"Hello, world!"`. Strings are immutable, meaning you can't change them directly; operations on strings produce new strings. Scala provides a rich set of methods for string manipulation, including concatenation, substring extraction, searching, and replacement.

StringsCoreEngineering
3 khái niệmChi tiết
Cốt lõiIDE Lab

sttp

sttp is an open-source HTTP client for Scala that provides a clean, programmer-friendly API to describe HTTP requests and handle responses. It supports various approaches to writing Scala code, including synchronous (direct-style), Future-based, and functional effect systems like cats-effect, ZIO, Monix, Kyo, and scalaz. sttp is designed to be extensible and integrates seamlessly with popular libraries for JSON handling, logging, metrics, and tracing.

sttpCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Sublime Text

Sublime Text is a sophisticated text editor known for its speed, ease of use, and features. It supports a wide range of programming languages, including Scala, through plugins and packages. Sublime Text offers features like multiple selections, a command palette, and extensive customization options, making it a popular choice for developers. With the Metals plugin, Sublime Text provides intelligent code completion, diagnostics, and refactoring capabilities for Scala. Resources

SublimeTextEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Tail recursion

Tail recursion is a special form of recursion where the recursive call is the last operation in the function. This allows the Scala compiler to optimize the recursion to prevent stack overflow and improve performance.

TailrecursionEngineering
2 khái niệmChi tiết
Cốt lõiIDE Lab

Tapir

Tapir is a library to describe HTTP APIs, expose them as a server, consume as a client, and automatically document using open standards. It is designed to be fast and developer-friendly, with a focus on type-safety, readability, and discoverability. Tapir provides integrations with many libraries in the Scala ecosystem, enhancing the developer’s toolbox with custom types, JSON handling, and observability features.

TapirCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Testing

Testing is the process of checking if a piece of software works as expected. It involves running the software with different inputs and conditions to find any errors, bugs, or unexpected behavior. The goal is to make sure the software is reliable, stable, and meets the requirements it was designed for.

TestingCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Total / partial functions

A total function is a function that is defined for every possible input value it can be given. In contrast, a partial function is a function that is only defined for a subset of possible input values. Partial functions can be used with collection methods like collect and collectFirst to manipulate and transform data. Resources

Total/Engineering
3 khái niệmChi tiết
Khuyên họcKiến thức

trait

A trait is a type that defines a contract of fields and methods, which can be either abstract (unimplemented) or concrete (implemented). Traits are used to share behavior across classes, enabling code reuse without relying on single inheritance. Traits are similar to Java 8’s interfaces. Classes and objects can extend traits using the extends keyword, but traits cannot be instantiated and therefore have no parameters.

traitCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Trampolines

Trampolines in Scala are used to avoid stack overflow errors in deep recursion by moving the computation from the stack to the heap. The TailRec class is part of the scala.util.control.TailCalls are used to implement trampolining.

TrampolinesCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Try

The Try class in Scala represents a computation that may fail during evaluation by raising an exception. It holds either a successfully computed value or the exception that was thrown.

TryCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Try/catch

Exception handling is done using the try/catch/finally construct, similar to Java. The try block contains code that might throw an exception, the catch block handles the exception, and the finally block is used for cleanup or other operations that must be performed regardless of whether an exception was thrown. Scala also encourages the use of functional error handling with monads like Try, Option, and Either, which provide a more composable and functional way to handle errors and exceptional cases.

Try/catchCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Type hierarchy

Generic types allow you to write code that can work with different types while maintaining type safety. Generic classes and traits take a type as a parameter within square brackets. For example, Stack\[A\] is a generic class that can be used to create stacks of any type A. Scala's type hierarchy is unified, with Any as the top type, which is the supertype of all types, and Nothing as the bottom type, which is the subtype of all types.

TypehierarchyEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Type parameters

Type parameters are used to create generic classes, traits, and methods. Type parameters are enclosed in square brackets and can be used to define methods and classes that work with different types while maintaining type safety.

TypeparametersEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

Type system

The Scala type system supports both object-oriented and functional programming paradigms. It is designed to be expressive and flexible, allowing developers to write concise and type-safe code. The type system includes features such as type inference, generics, variance annotations, type bounds, abstract types, higher-kinded types, type classes, and implicit resolutions. It is one of the most sophisticated type systems in any programming language, combining comprehensive ideas from both functional programming and object-oriented programming.

TypesystemEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Typeclasses

Typeclasses are a concept used in functional programming to achieve ad-hoc polymorphism. They define a set of functions that can be implemented for a type fulfilling certain requirements, providing a way to add functionality to existing types without modifying their source code. Typeclasses are not natively supported in Scala but can be implemented using traits and implicit classes.

TypeclassesCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

The unapply method

The unapply method is used to deconstruct instances through pattern matching. It is often used in extractor objects to extract data values compacted in objects. Resources

TheunapplyEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

Unit

Unit is a data type in Scala that represents a placeholder when no meaningful value needs to be returned. It's similar to `void` in languages like Java or C. The unit type has only one possible value, written as `()`. You'll often see it used as the return type of functions that perform side effects but don't produce a result, or when a function is required to return a value but there's no logical value to return.

UnitCoreEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

uPickle

uPickle is a simple, fast, and dependency-free JSON serialization library for Scala. It is designed to handle statically-typed, tree-shaped, immutable data structures efficiently. uPickle is part of the Scala Toolkit and integrates well with other Scala libraries.

uPickleCoreEngineering
3 khái niệmChi tiết
Cốt lõiKiến thức

uTest

uTest is a simple and convenient testing library for Scala. It provides essential features in their minimal form, avoiding unnecessary complexity. uTest allows you to organize tests in a hierarchical structure and run them at various levels, from individual tests to entire suites. It is designed to be straightforward to use, making it a good choice for developers who want to focus on writing tests without dealing with excessive configurations or features.

uTestCoreEngineering
2 khái niệmChi tiết
Khuyên họcKiến thức

Variables & Constants

Variables are named storage locations that hold data, and their values can be changed during the program's execution. In Scala, variables are declared using the `var` keyword. On the other hand, constants are also named storage locations, but their values cannot be modified once they are assigned. Constants are declared using the `val` keyword in Scala, making them immutable. Choosing between `var` and `val` depends on whether you need to change the value of a data item during the program's runtime.

Variables&Engineering
3 khái niệmChi tiết
Cốt lõiKiến thức

Context bounds

Context Bounds in Scala is a feature that provides a shorthand syntax for expressing the common pattern of a context parameter that depends on a type parameter. Context bounds are used to simplify the code for generic types and are particularly useful in the context of type classes.

ContextboundsEngineering
3 khái niệmChi tiết
Khuyên họcIDE Lab

Vector

Vectors in Scala are indexed, immutable sequences. Think of them as similar to arrays, but with the key advantage of being immutable – meaning their contents cannot be changed after creation. This makes them very useful in concurrent programming and for data structures where you want to guarantee that data isn't accidentally modified. Vectors provide fast access to elements by index (like arrays), making them efficient for lookups and various data manipulations.

VectorCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Video game engines

The video game development landscape is ruled mainly by C++, but there is a small but active scene of games developed in JVM languages - for example, Minecraft was coded in Java. Scala's interoperability with Java makes it possible to develop video games using Java solutions, like LibGDX and LWJGL, but there are also game engines written directly in Scala.

VideogameEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

Views

Views are used to create lazy versions of collections. They are essentially reusable iterators that implement the same interfaces as regular collections.

ViewsCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

VIm

Vim is a highly configurable text editor known for its efficiency and features. When equipped with the Metals plugin, Vim becomes a capable environment for Scala development, offering features like code completion, refactoring, and debugging.

VImCoreEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

VS Code

Visual Studio Code (VS Code) is a popular IDE known for its lightweight design and extensive customization options. When equipped with the Metals extension, VS Code becomes a powerful tool for Scala development, offering features like code completion, refactoring, debugging, and integration with build tools like sbt and Maven.

VSCodeEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Working with Strings

Scala offers various ways to manipulate strings, such as combining them (concatenation), finding their length, or extracting parts of them. String interpolation is a feature that lets you embed variables directly within strings, making it easier to build dynamic text. For example, you can use `s"My name is $name"` where `name` is a variable, and Scala will replace `$name` with its actual value when the string is created.

WorkingwithEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

YouTube

YouTube can be a fantastic resource for learning Scala. On the platform, you can find a wide variety of content, from beginner-friendly tutorials introducing basic concepts to in-depth explanations of advanced topics. Many experienced Scala developers and educators create and share their knowledge on YouTube, often demonstrating practical examples and real-world applications, allowing learners to visually grasp the concepts and follow along with code demonstrations.

YouTubeCoreEngineering
1 khái niệmChi tiết
Cốt lõiKiến thức

Zed

Zed is a modern, lightweight, and highly performant code editor designed for efficiency and ease of use. It offers features like real-time collaboration, a minimalistic interface, and editing capabilities. While Zed is not specifically designed for Scala development, its extensibility and support for various programming languages make it a versatile tool for developers. With the Metals plugin, Zed provides intelligent code completion, diagnostics, and refactoring capabilities for Scala.

ZedCoreEngineering
3 khái niệmChi tiết
Khuyên họcKiến thức

ZIO Streams

ZIO Streams is a purely functional streaming library that uses the ZIO runtime. It is designed for working with large or infinite data, providing automatic backpressure handling, non-blocking and asynchronous processing, and a rich set of stream combinators. ZIO Streams ensures resource safety and efficient processing, making it suitable for building scalable and resilient streaming applications.

ZIOStreamsEngineering
1 khái niệmChi tiết
Cốt lõiIDE Lab

ZIO Test

ZIO Test is a testing library for Scala that makes it easy to test effectual programs. It is tightly integrated with ZIO, allowing tests to be treated as immutable values, which simplifies testing asynchronous and concurrent code. ZIO Test provides features like resource management, property-based testing, and support for various platforms, including JVM, ScalaJS, Dotty, and Scala Native.

ZIOTestEngineering
1 khái niệmChi tiết
Khuyên họcKiến thức

ZIO

ZIO is a Scala framework designed for asynchronous and concurrent programming. It emphasizes type safety, composability, and resource safety, making it suitable for building scalable and resilient applications. The ZIO ecosystem includes libraries for HTTP, logging, configuration, streams, and testing, all built on top of ZIO's effect system. ZIO's fibers are lightweight and non-blocking, providing high performance and scalability.

ZIOCoreEngineering
2 khái niệmChi tiết
Cốt lõiKiến thức

ZIO

ZIO is a Scala framework for asynchronous and concurrent programming. It is designed to be type-safe, composable, and highly scalable, allowing developers to build safe applications. ZIO provides a comprehensive set of tools for managing resources, handling concurrency, and ensuring program safety. It leverages the full power of the Scala compiler to catch bugs at compile time and allows for easy construction of concurrent applications without deadlocks, race conditions, or complexity.

ZIOCoreEngineering
3 khái niệmChi tiết