Published Mar 7, 2018

Clean Architecture - What is the Humble Object Pattern?

Michael and Joe dive into Clean Architecture, examining the Humble Object Pattern and its role in modular code. They also discuss effective community engagement, data handling, and share practical programming tips.
Episode Highlights
Coding Blocks logo

Popular Clips

Episode Highlights

  • Data Formatting

    Data formatting is crucial for maintaining a clean separation of concerns in software architecture. Alan Underwood emphasizes that views should not handle data formatting; instead, this responsibility should lie with the viewmodel or presenter object 1. This approach ensures that data is consistently formatted across different platforms and clients, avoiding redundancy and potential errors. Joe Zack adds that locale-specific formatting decisions, such as currency or date formats, should be made server-side to maintain consistency 2.

    If you needed something to be formatted in a particular currency, the view should not be doing that. That data should be formatted, provided to the viewmodel.

    --- Alan Underwood

    This method also simplifies the view layer, making it easier to manage and test.

       

    ORM Concepts

    Object-relational mapping (ORM) presents unique challenges and considerations. Alan Underwood and Joe Zack discuss the distinction between objects and data structures, noting that ORMs often create data structures with no implied behavior 3. This can lead to confusion and misuse, as developers might expect more functionality from these objects than they provide. The debate extends to database gateways, which serve as interfaces for CRUD operations and help maintain clean architecture principles 4.

    What you get out of an ORM is a data structure. It's literally the record from a database or the record from some sort of storage thing just basically shoved into an object.

    --- Alan Underwood

    Understanding these distinctions is key to effectively using ORMs and maintaining a clean, maintainable codebase.

Related Episodes