Upgrade to Pro — share decks privately, control downloads, hide ads and more …

オブジェクトのおしゃべり大失敗 メッセージングアンチパターン集 / messaging anti-pattern collection

オブジェクトのおしゃべり大失敗 メッセージングアンチパターン集 / messaging anti-pattern collection

Object-Oriented Conference2024での内容です

オブジェクトたちがおしゃべりする世界、それはまるで魔法のようにシステムを動かすことができる力です。
しかし、その裏にはオブジェクトたちの失言や伝言ゲーム、嘘などの罠がたくさん潜んでいます。
良かれと思って導入した非同期処理のQueueやストリーミング処理で失敗はありませんか?

ネット上にある記事を鵜呑みにしてしまうと致命的なアンチパターンに繋がってしまうことも多くあります。
状態をもたせないイベントでマテリアライズドビュー化してしまう、
巨大なランタイムを持たせてしまったハンドラ、
なぜ時系列通りに処理がされなくなってしまうのか、なぜ処理がスタックしてしまうのか、
更新よりも削除が先に動いてしまうのはなぜ?
シリアライズしたオブジェクトが戻せない、副問合せで状態が変わってしまった・・

あの時、どうすればこうした自体を招かずに済んだのでしょうか。
ちょっとしたきっかけでメッセージを使ったシステムを簡単に壊してしまうことがあります。

このセッションでは、ちょっとしたミスやあるきっかけが招くメッセージングのアンチパターンをユーモアたっぷりに解説します。
アンチパターンから抜け出すための時系列とモデリング、
そしてメッセージのルーティングなどを理解しておきましょう。

https://fortee.jp/oocon-2024/proposal/1d11d991-3660-44da-8e2b-7d9bd1e5ed1f

yuuki takezawa

March 26, 2024
Tweet

More Decks by yuuki takezawa

Other Decks in Technology

Transcript

  1. QSP fi MF  • ஛ᖒ༗وBLBZUBLF • ઍגࣜձࣾ$50ٕज़ސ໰ωοτϓϩςΫγϣϯζ΄͔ • (P4DBMB

    • ΞΫλʔϞσϧେ޷͖ • ϚΠΫϩαʔϏεΞʔΩςΫνϟɾϦΞΫςΟϒγεςϜɺ ϨΨγʔվળ΍43&%3&ɺ֤छϞσϦϯάͷࢧԉͳͲ • 9IUUQTUXJUUFSDPNFY@UBLF[BXB
  2.  import ( "fmt" ) type MyStruct struct { value

    string } func (m *MyStruct) SetValue(val string) { m.value = val } func (m *MyStruct) Display() { m.AnotherMethod(m.value) } func (m *MyStruct) AnotherMethod() { fmt.Println(m.value) } func main() { myInstance := MyStruct{} myInstance.SetValue("Hello, Go!") myInstance.Display() }
  3.  $3&"5&5"#-&KPVSOBMT  JE7"3$)"3  /05/6--  QBZMPBE+40/#/05/6--  TFRVFODF@OVNCFS#*(*/5

     BDUPS@OBNF7"3$)"3   DSFBUFE@BU5*.&45".18*5)5*.&;0/&%&'"6-5$633&/5@5*.&45".1  13*."3:,&: JE  6/*26& JE  6/*26& BDUPS@OBNF TFRVFODF@OVNCFS  
  4.  { "transaction_id": "1234567890", "transaction_date": "2016-01-01", "transaction_amount": 100.00, "transaction_user_id": 1,

    "tax_id": 11, "items": [ { "item_id": 1, "item_quantity": 1 }, { "item_id": 2, "item_quantity": 2 } ] }
  5.  { "transaction_id": "1234567890", "transaction_date": "2016-01-01", "transaction_amount": 100.00, "transaction_user_id": 1,

    "tax_id": 11, "items": [ { "item_id": 1, "item_quantity": 1 }, { "item_id": 2, "item_quantity": 2 } ] } UBY@JEΛݩʹ໰͍߹Θͤ ͭ·Γ໰͍߹Θͤͨͱ͖ͷ΋ͷʹ O XJUIঢ়ଶ෮ݩ͕೉͍͠
  6.  { "transaction_id": "1234567890", "transaction_date": "2016-01-01", "transaction_amount": 100.00, "transaction_user_id": 1,

    "tax_id": 11, "items": [ { "item_id": 1, "item_quantity": 1 }, { "item_id": 2, "item_quantity": 2 } ] } ΞΠςϜ͝ͱͷՁ͕֨ɺ ͦͷ࣌ͷ࠷৽৘ใʹ ೥ޙ΋ಉ͡஋Ͱ͋Δอূ͕ͳ͍
  7.  { "transaction_id": "1234567890", "transaction_date": "2016-01-01", "transaction_amount": 100.00, "transaction_user_id": 1,

    "tax_id": 11, "items": [ { "item_id": 1, "item_quantity": 1 }, { "item_id": 2, "item_quantity": 2 } ] } ੥ٻॻͷΑ͏ͳ࢓૊Έͷ৔߹ɺ Ϣʔβʔ໊͕มΘΔͱաڈͷ΋ͷ΋ มߋ͞ΕΔ͜ͱΛҙຯ͍ͯ͠·͢ ͭ·Γ෮ݩෆՄ