Abstract and Self Types

Designing and writing high-quality code in software engineering is important in order to have applications that are easy to extend and maintain. This activity requires the domain to be well-known, correctly understood by a developer, and the requirements for the application to be well-defined. If any of these are absent, then writing good programs becomes quite challenging.

Often, engineers model the world using some abstractions. This helps with code extendibility and maintainability and removes duplication, which in many cases could be a reason for bugs. Good code, generally, will consist of multiple small components, that depend on and interact with each other. There are different approaches that help to achieve ...

Get Scala Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.