Exploring Classes as Types
With chapters selected by Matthias Noback
  • September 2020
  • ISBN 9781617298776
  • 59 pages
Want a clever hack to up your object-oriented programming game? Treating classes as an extension of the type system gives you classes that are both easier to use and more predictable —as well as a bunch of other awesome advantages! Now, in Exploring Classes as Types you'll get your first glimpse into how this powerful technique can revolutionize the way you write code. All 100% FREE.

About the book

In Exploring Classes as Types, author and veteran web developer Matthias Noback has chosen content from three Manning books that explore this powerful technique. The first chapter showcases the numerous benefits that come with strongly typed code. Then, you'll drill down into different categories of objects and when and how to use them. Lastly, you'll zoom in on value objects, which are particularly well-suited to unit testing, and discover how they help to expand the "safe area" inside your application. With this laser-focused sampler, you'll be on your way to harnessing the power that treating classes as types offers!
Table of Contents detailed table of contents


Part 1: Introduction to typing

Introduction to typing

1.1 Why types exist

1.1.1 0s and 1s

1.1.2 What are types and type systems?

1.2 Benefits of type systems

1.2.1 Correctness

1.2.2 Immutability

1.2.3 Encapsulation

1.2.4 Composability

1.2.5 Readability

Part 2: Creating other objects

Creating other objects

3.1 Require the minimum amount of data needed to behave consistently

3.2 Require data that is meaningful

3.3 Don’t use custom exception classes for invalid argument exceptions

3.4 Test for specific invalid argument exceptions by analyzing the exception’s message

3.5 Extract new objects to prevent domain invariants from being verified in multiple places

3.6 Extract new objects to represent composite values

3.7 Use assertions to validate constructor arguments

Part 3: The basics of unit testing

The basics of unit testing

1.1 Defining unit testing, step by step

1.1.1 The importance of writing good unit tests

1.1.2 We’ve all written unit tests (sort of)

1.2 Properties of a good unit test

1.3 Integration tests

1.3.1 Drawbacks of nonautomated integration tests compared to automated unit tests

1.4 What makes unit tests good

1.5 A simple unit test example

1.6 Test-driven development

1.7 The three core skills of successful TDD

What's inside

  • "Introduction to Typing" – Excerpt from Chapter 1 from Programming with Types by Vlad Riscutia
  • "Creating other objects" – Excerpt from Chapter 3 from Object Design Style Guide by Matthias Noback
  • "The basics of unit testing" – Chapter 1 from The Art of Unit Testing by Roy Osherove

About the author

Matthias Noback is a professional web developer with nearly two decades of experience. He runs his own web development, training, and consultancy company called "Noback's Office."

placing your order...

Don't refresh or navigate away from the page.
eBook $0.00 PDF only + liveBook
Exploring Classes as Types (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.

FREE domestic shipping on three or more pBooks