100 lines
2.2 KiB
YAML
100 lines
2.2 KiB
YAML
uuid:
|
|
- value: 768ec43f-2c43-4071-9a7b-f53b5df43a33
|
|
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:02+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: 'Actions, Commands or Services?'
|
|
created:
|
|
- value: '2025-01-06T00:00:00+00:00'
|
|
changed:
|
|
- value: '2025-05-11T09:00:02+00:00'
|
|
promote:
|
|
- value: false
|
|
sticky:
|
|
- value: false
|
|
default_langcode:
|
|
- value: true
|
|
revision_translation_affected:
|
|
- value: true
|
|
path:
|
|
- alias: /daily/2025/01/06/actions-commands-services
|
|
langcode: en
|
|
body:
|
|
- value: |
|
|
<p>Today I started to write a new class and was trying to decide what to name it and what pattern I wanted to follow.</p>
|
|
|
|
<p>Option 1:</p>
|
|
|
|
<pre><code class="php">class StoreInformationDownloader {
|
|
|
|
public function download() {
|
|
// ...
|
|
}
|
|
}
|
|
</code></pre>
|
|
|
|
<p>Option 2:</p>
|
|
|
|
<pre><code class="php">class DownloadStoreInformation {
|
|
|
|
public function execute() {
|
|
// ...
|
|
}
|
|
}
|
|
</code></pre>
|
|
|
|
<p>Option 1 is a typical Service class.</p>
|
|
|
|
<p>Option 2 follows the Command or Action pattern.</p>
|
|
|
|
<p>Which would you choose?</p>
|
|
|
|
|
|
format: full_html
|
|
processed: |
|
|
<p>Today I started to write a new class and was trying to decide what to name it and what pattern I wanted to follow.</p>
|
|
|
|
<p>Option 1:</p>
|
|
|
|
<pre><code class="php">class StoreInformationDownloader {
|
|
|
|
public function download() {
|
|
// ...
|
|
}
|
|
}
|
|
</code></pre>
|
|
|
|
<p>Option 2:</p>
|
|
|
|
<pre><code class="php">class DownloadStoreInformation {
|
|
|
|
public function execute() {
|
|
// ...
|
|
}
|
|
}
|
|
</code></pre>
|
|
|
|
<p>Option 1 is a typical Service class.</p>
|
|
|
|
<p>Option 2 follows the Command or Action pattern.</p>
|
|
|
|
<p>Which would you choose?</p>
|
|
|
|
|
|
summary: null
|
|
field_daily_email_cta: { }
|