In general, constuctor injection is good as it enables loosely coupled code. But, things start to look a bit off-putting when their constructors look
I was working on implementing my own DI container. I put my business logic and handlers in service layers that are talking against trait(or interface
Trait checking implementation is not provided in Rust WITHOUT cost. However, it doesn't mean that you cannot implement it. Here is how.
Quick quiz! Guess what the output of the following code will be:If you guessed that the answer would be 44 or the code will not compile, continue read
When working on business core domain logic, we want to have your application code open for extension but close against modification, aka Open-closed p
Temporal Coupling In many Object-oriented programming languages, temporal coupling becomes an issue when an object requires methods to be called in a
본 포스트에서는 Spin Lock을 실제로 구현해보고 러스트에서 아래의 개념들을 어떻게 활용하는지를 파헤쳐본다. Atomic values, Lock, MutexGuard, UnsafeCell, Send/Sync
In the last post, I talked about Constructor Injection. If you haven't already, make sure to check it out. We want our code to be open to extensibilit
In Object-Oriented Programming world, we often use Constructor Injection pattern, which is where you define a list of required dependencies by specify
Rust의 Type시스템은 강력하다 - 너무 강력해서, 현업코드에서도 타입시스템을 믿고 Refactoring하는 경우가 많다.가령 Enum타입은, 내부 요소로 존재하는 모든 variants들에 대해서, match clause안에서 반드시 매치되길 강제한다. 아래 코드를
일전의 포스트에서 Happens-before relationship에 대해 다룬 바가 있다. 오늘의 포스트는 해당 내용에 대한 기본적인 이해가 필요하니, 아래 포스트의 내용을 먼저 이해하고 읽어보길 권장한다. https://velog.io/@migorithm/Demy
프로그래머에게, "윗줄 부터 아래로는" 굉장히 직관적인 사고 방식이다. 그러나, 현실과 직관은 가끔 다를 수 있다.
러스트를 두고 많은 사람들이 말한다. "If it compiles, it works." 과연 그럴까?
자, 아래 4개의 명제중 참인 것을 골라보자.T: 'static 은 T는 'static lifetime을 가졌다는 의미이다.&'static T 와 T: 'static 은 같다.만약 T:'static 이면, T의 값은 변경시킬 수 없다.만약 T:'static 이면, T는
Dispatches Dispatch is the process of selecting which implementation of a polymorphic operation (method or function) If that happens at runtime, we call it dynamic dispatch whereas static dispatch is...
In the last article(https://velog.io/@migorithm/Fluent-Rust-Type-State-Pattern), I covered one way of handling type state pattern in Rust. As saf
If you have written Rust code, you may have heard of so many great things about type state pattern. It’s where the current state of an object is kept
As stated in Rustonomicon, Dot operator in Rush does a lot of magics for you. Namely, those are auto-referencing, auto-dereferencing, coercion UNTIL t