O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Real-World Software Development

Book Description

With Early Release ebooks, you get books in their earliest form—the author's raw and unedited content as he or she writes—so you can take advantage of these technologies long before the official release of these titles.

Explore the latest Java-based software development techniques and methodologies through the project-based approach in this practical guide. Unlike books that use abstract examples and lots of theory, Real-World Software Development shows you how to develop several relevant projects while learning best practices along the way.

With this engaging approach, junior developers capable of writing basic Java code will learn about state-of-the-art software development practices for building modern, robust and maintainable Java software. You’ll work with many different software development topics that are often excluded from software develop how-to references.

Featuring real-world examples, this book teaches you techniques and methodologies for functional programming, automated testing, security, architecture, and distributed systems.

Table of Contents

  1. Preface
    1. Why we wrote this Book
    2. A Developer Oriented Approach
    3. What’s in the Book?
    4. Who should read this book?
    5. Conventions Used in This Book
    6. Using Code Examples
    7. O’Reilly Online Learning
    8. How to Contact Us
    9. Acknowledgments
  2. 1. Introduction
    1. Themes
    2. Chapter Summary
    3. Iterating on You
  3. 2. The Bank Statements Analyser
    1. The Challenge
    2. The Goal
    3. Bank Statement Analyser Requirements
    4. KISS Principle
      1. final Variables
    5. Code Maintainability and Anti-patterns
      1. God Class
      2. Code Duplication
    6. Single Responsibility Principle
    7. Cohesion
      1. Class-level cohesion
      2. Method-level cohesion
    8. Coupling
    9. Testing
      1. Automated Testing
      2. Using jUnit
      3. Code coverage
    10. TakeAways
    11. Iterating on You
    12. Completing The Challenge
  4. 3. Extending The Bank Statements Analyser
    1. The Challenge
    2. The Goal
    3. Extended Bank Statements Analyser Requirements
    4. Open for Extension and Closed for Modification Principle
      1. Creating an instance of a functional interface
      2. Lambda Expressions
    5. Interfaces gotchas
      1. God interface
      2. Too Granular
    6. Explicit vs. Implicit API
      1. Domain class or primitive value?
    7. Multiple exporters
      1. Introducing a domain object
      2. Defining and implementing the appropriate interface
    8. Exception handling
      1. Why use exceptions?
      2. Patterns and anti-patterns with exceptions
      3. Guidelines for using exceptions
      4. Alternatives to exceptions
    9. Using a build tool
      1. Why use a build tool?
      2. Using Maven
      3. Using Gradle
    10. TakeAways
    11. Iterating on You
    12. Completing The Challenge
  5. 4. The Document Management System
    1. The Challenge
    2. The Goal
    3. Document Management System Requirements
    4. Fleshing out the Design
      1. Importers
      2. The Document Class
      3. Attributes and Hierarchical Documents
      4. Implementing and Registering Importers
    5. The Liskov Substitution Principle (LSP)
    6. Alternative Approaches
      1. Making Importer a class
      2. Scoping and Encapsulation Choices
    7. Extending and Reusing Code
    8. Test Hygiene
      1. Test Naming
      2. Behaviour not Implementation
      3. Don’t Repeat Yourself
      4. Good Diagnostics
      5. Testing Error Cases
      6. Constants
    9. TakeAways
    10. Iterating on You
    11. Completing The Challenge
  6. 5. The Business Rules Engine
    1. The Challenge
    2. The Goal
    3. Business Rule Engine Requirements
    4. Test Driven Development
      1. Why use TDD?
      2. The TDD cycle
    5. Mocking
    6. Adding Conditions
      1. Modeling state
      2. Local Variable Type Inference
      3. Switch Expressions
      4. Interface Segregation Principle
    7. Designing a Fluent API
      1. What is a Fluent API?
      2. Modelling the domain
      3. Builder pattern
    8. TakeAways
    9. Iterating on You
    10. Completing The Challenge
  7. 6. Twootr
    1. The Challenge
    2. The Goal
    3. Twootr Requirements
    4. Overview Design
      1. Pull Based
      2. Push Based
    5. From Events to Design
      1. Communication
      2. GUI
      3. Persistence
      4. The Hexagonal Architecture
    6. Where to Begin
    7. Passwords and Security
    8. Followers and Twoots
      1. Modelling Errors
      2. Twooting
      3. Creating Mocks
      4. Verifying with Mocks
      5. Mocking Libraries
      6. SenderEndPoint
    9. Positions
      1. The equals and hashcode methods
      2. The Contract between equals() and hashCode()
    10. Iterating on You
    11. Completing The Challenge
  8. 7. Extending Twootr
    1. The Challenge
    2. The Goal
    3. Recap
    4. Persistence and The Repository Pattern
      1. Designing the Repositories
      2. Query Objects
    5. Functional Programming
      1. Lambda Expressions
      2. Method References
      3. Execute Around
      4. Streams
      5. Optional
    6. User Interface
    7. Dependency Inversion and Dependency Injection
    8. Packages and Build Systems
    9. Limitations and Simplifications
    10. TakeAways
    11. Iterating on You
    12. Completing The Challenge
  9. 8. Conclusion
    1. Project Based Structure
    2. Iterating on You
    3. Deliberate Practice
    4. Next Steps and Additional Resources