{ "uuid": [ { "value": "e187ec3b-5cde-4ab2-8c05-2d38eaa99756" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T09:00:06+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Make the change easy, then make the easy change" } ], "created": [ { "value": "2024-10-04T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:06+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2024\/10\/04\/make-the-change-easy--then-make-the-easy-change", "langcode": "en" } ], "body": [ { "value": "\n

This week, I've been working on a particular component that processes and displays live data from APIs.<\/p>\n\n

As the data is live, it's constantly changing and it's unlikely I'll see all the different states and use-cases that the data could be in.<\/p>\n\n

There's also no guarantee the API will be available and I also may need to work offline with no Internet access to connect to the API.<\/p>\n\n

I'm reminded of the quote by Kent Beck:<\/p>\n\n

\n

For each desired change, make the change easy (warning: this may be hard), then make the easy change.<\/p>\n<\/blockquote>\n\n

In this case, to make the change easy, I need the data to be consistent, to see all the use-cases and permutations and to be available offline.<\/p>\n\n

To make the change easy, I created a fake version of the service class that returns static data I can work with.<\/p>\n\n

I can add whatever data I need to give me the examples and situations to work with and by implementing the same methods as the real service class, I can swap them without changing any other code.<\/p>\n\n

Now I can make the easy change.<\/p>\n\n ", "format": "full_html", "processed": "\n

This week, I've been working on a particular component that processes and displays live data from APIs.<\/p>\n\n

As the data is live, it's constantly changing and it's unlikely I'll see all the different states and use-cases that the data could be in.<\/p>\n\n

There's also no guarantee the API will be available and I also may need to work offline with no Internet access to connect to the API.<\/p>\n\n

I'm reminded of the quote by Kent Beck:<\/p>\n\n

\n

For each desired change, make the change easy (warning: this may be hard), then make the easy change.<\/p>\n<\/blockquote>\n\n

In this case, to make the change easy, I need the data to be consistent, to see all the use-cases and permutations and to be available offline.<\/p>\n\n

To make the change easy, I created a fake version of the service class that returns static data I can work with.<\/p>\n\n

I can add whatever data I need to give me the examples and situations to work with and by implementing the same methods as the real service class, I can swap them without changing any other code.<\/p>\n\n

Now I can make the easy change.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "1970-01-01T00:33:45+00:00", "guid": null, "hash": "4284e8bf5254c92b4ec97575e0b82116", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }