Menu
Coddy logo textTech

Project Overview

Part of the Object Oriented Programming section of Coddy's Dart journey — lesson 101 of 110.

challenge icon

Challenge

Easy

In this chapter, you'll build a Library Management System that combines classes, encapsulation, and design patterns into a working application.

Let's start by setting up the project structure with a simple Book class - the foundation that all future lessons will build upon.

You'll create two files:

  • book.dart: Define a Book class with three properties: isbn (String), title (String), and author (String). Include a constructor that initializes all three properties, and override the toString() method to return the book's information in the format [isbn] title by author.
  • main.dart: Import your book file and create two books to verify your class works correctly. Create a book with ISBN 978-0-13-468599-1, title The Pragmatic Programmer, and author David Thomas. Create a second book with ISBN 978-0-596-51774-8, title JavaScript: The Good Parts, and author Douglas Crockford. Print both books (which will use your toString() method).

This simple structure establishes the file organization pattern you'll follow throughout the project. In upcoming lessons, you'll expand this with user classes, borrowing logic, and more!

Expected output:

[978-0-13-468599-1] The Pragmatic Programmer by David Thomas
[978-0-596-51774-8] JavaScript: The Good Parts by Douglas Crockford

Try it yourself

import 'book.dart';

void main() {
  // TODO: Create a book with ISBN '978-0-13-468599-1', title 'The Pragmatic Programmer', and author 'David Thomas'
  
  // TODO: Create a second book with ISBN '978-0-596-51774-8', title 'JavaScript: The Good Parts', and author 'Douglas Crockford'
  
  // TODO: Print both books (this will use the toString() method)
}

All lessons in Object Oriented Programming