Grzegorz Korba Profile picture
Dec 14 β€’ 7 tweets β€’ 4 min read
πŸ“ŠπŸ§΅ #CoditoStats πŸ™‚

While I don't care much about numbers, I check #TwitterAnalytics from time to time mostly because of monthly summaries. Let me tell you that last 28 days were pretty intense comparing to previous period 😁

Let's look what happened! πŸ‘‡ Image
First of all @davorminchorov mentioned me in his thread about enums. We initially had discussion about them under his PR (github.com/learnhubdev/la…), but this thread extended it even more πŸ™‚



(187 engagements at this point)
That motivated me to write thread about dictionaries, how I see them from theoretical and practical point of view πŸ™‚ If you missed it, grab it here:

Image
In the meantime I wrote thread about Value Objects and that's my Top Tweet with 12.5K impressions earned 😎 I'm pretty satisfied with it because it looks like many people found it, ekhm, Valueable πŸ˜‰

Image
My Top media Tweet earned 3,169 impressions and it was about #Git rebase command. I am a rebase advocate and was able to convert few developers I worked with, maybe I can convince you too πŸ˜‰?

Image
My Top Follower in this period is none other than @matthiasnoback and that was one of the best moments of December 😁 Being followed by person such widely recognised in #PHP world is a massive compliment for me. Thank you!
Of course big THANKS 🍻 to all of 70 new followers, I hope you enjoyed my content in this period and I'm looking forward to deliver more helpful stuff in the future πŸ™‚

As always I am open for discussion, so don't hesitate and give feedback, please πŸ™

Cheers!

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Grzegorz Korba

Grzegorz Korba Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @_Codito_

Dec 16
In recent days I saw several examples of "actions" in #Laravel, but one especially got my attention and I wanted to clarify it - so we had little discussion with @wendell_adriel and I would like to share my opinion about this particular approach πŸ™‚

πŸ§΅πŸ‘‡

Before we start, one important preface: I'm big fan of explicitness and testability, so I'm using dependency injection everywhere (where's applicable). Examples in this thread will use it too by default, along with #PHP 8.0+ syntaxes.
What caught my attention was instantiating action inside controller's method πŸ€” That looked suspicious, because I'm used to different nomenclature.

My assumption after looking at the example was that `CreateUserAction` is more like a #CQRS command rather than action.
Read 22 tweets
Dec 5
πŸ€” Dictionaries: should they be in the database? πŸ€”

Dictionary is set of values that are supported in your application. But how they should be defined? Well, as always, it depends πŸ˜‰ #PHP #architecture

Let me tell you what I think about it πŸ‘‡πŸ§΅
In general, I believe there are two types of dictionaries:

1) Internal, related to your app's logic
2) UI-managable, related to app instance's data

Let's look about difference between them πŸ™‚
Internal dictionaries are represented in the code. With #PHP 8.1+ it's pretty straightforward - you can use enums πŸ™‚ When you need to represent some state, string-backed enum is the best choice, because it's much better for debugging purposes. PHP 8.1 string-backed enum
Read 18 tweets
Dec 4
πŸ’‘Value Object: what's that?

Basically, it's a simple object representation of some kind of reusable data structure. Unlike entity, it does not have identity, so value objects are considered as equal if underlying data is equal.

Want to know more? Read below πŸ‘‡πŸ§΅ #architecture Value Object representing name
Value Objects encapsulate data and ensure its validity - constructor can, and should, check if provided primitive values are correct. Thanks to that, when you pass VO to other methods, you can be sure it carries proper information πŸ™‚
Value Object's reusability doesn't mean you reuse data it carries. You reuse its structure across other Value Objects or Entities. Name can be used for modelling Employee, Client and other.

So you can have several John Doe employees with the same Name, but different Id πŸ™‚ Examples of `Name` Value Object usage
Read 8 tweets
Aug 24
There were many discussions if #Laravel's facades implement GoF's Facade Pattern, but I think it does not matter at this point - the team won't change naming convention anyway. Naming is not a problem, I see other issues with facades - a #PHP thread 🧡
1) They're basically magic πŸͺ„ Some may see it as advantage, but I consider it as drawback. You don't execute exact code you're calling, but your call is proxied to some underlying service. It strictly couples your code with the framework, which handles it.
Facades' API has to be added as comments in PHPDoc (with `@Method`) which is error prone because it's easy to forget to update facade's phpdoc when underlying service (accessor) is changed. But even if autocompletion in IDE works, you just can't simply navigate to method's code.
Read 18 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(