oliverdavies.uk/content/node.e187ec3b-5cde-4ab2-8c05-2d38eaa99756.json

91 lines
No EOL
4 KiB
JSON

{
"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 <p>This week, I've been working on a particular component that processes and displays live data from APIs.<\/p>\n\n<p>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<p>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<p>I'm reminded of the quote by Kent Beck:<\/p>\n\n<blockquote>\n <p>For each desired change, make the change easy (warning: this may be hard), then make the easy change.<\/p>\n<\/blockquote>\n\n<p>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<p>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<p>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<p>Now I can make the easy change.<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p>This week, I've been working on a particular component that processes and displays live data from APIs.<\/p>\n\n<p>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<p>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<p>I'm reminded of the quote by Kent Beck:<\/p>\n\n<blockquote>\n <p>For each desired change, make the change easy (warning: this may be hard), then make the easy change.<\/p>\n<\/blockquote>\n\n<p>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<p>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<p>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<p>Now I can make the easy change.<\/p>\n\n ",
"summary": null
}
]
}