nakajima jun
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    セキュア・バイ・デザイン 第5章 ドメイン・プリミティブ === ###### tags: `セキュア・バイ・デザイン読書会` # Discord開始位置 - # 自己紹介 - なかじま(J.Nakajima) - ファシリ役 - タイムキーパー役 - こばやし(t2_Kobayashi) - 読み上げ役 # 参加の仕方 - マイクはいつでもONにして、話に参加して結構です。 - テキストチャットでも、コメントやリアクションでどんどん参加してください!ラジオ担当が拾っていきます。 - 聞いているだけの方もOKです! # ディスカッションをより豊かにするためのグランドルール - 参加者は毎回任意 - 今回は不参加、次回は参加をするといった気軽な感じ - 途中参加も断然OK! まずは聞くだけでも大丈夫です! - フィードバックを恐れない - マサカリは怖いと思いますが、アウトプットからのフィードバックを受け、学びを深めていきましょう - アウトプット7割:インプット3割の気持ちで臨みましょう! - 経験の有る無しは気にしない - 自分はDDD非経験者だから……と気後れする必要はないです - 堂々と意見や疑問を語りましょう - ページ数と同時に、節のタイトルやキーワードを言って頂けるとスムーズです - 電子書籍で読んでいるとページ数ではわからないため - 話していない人が、率先してメモしましょう - このHackMDはみんなのものです。どんどん書いていきましょう:+1: :+1: - 気になる質問や同感するものには :+1: を末尾につけてください。 # タイムテーブル | 時間 | 所要時間 | 内容 |備考 | | -------- | -------- | -------- | -------- | | 19:50- | - | 集合開始 | | | 20:00-20:15 | 15分 | 当日の流れとグランドルールの共有 | | | 20:15-20:25 | 10分 | 感想記入&HackMDに書かれた皆さんの感想・気づき・疑問をもっと掘り下げたいものを、 :+1: 付けていく | | | 20:25-21:55 | 90分 | 本の節ごとにディスカッション(ここでも適宜、HackMDに気づきとか書いていってもらっていいです) | | |21:55-22:00 | 5分 | 次回開催日と読む範囲決めてクローズ | | ## 下に感想などを書いていって下さい。どんな些細なことでもOKです。 --- # (お試し運用)この用語がわからない、難しい ※ここに本を読んでわからなかった用語を書いていってください。 ※私もわからなかった、という方がいれば、:+1:をつけてください - (例)集約とは? # 第5章 序章 ## 目安の時間 - xx分 ## 感想・気づき ## 疑問 --- # 5.1 ドメイン・プリミティブ(domain primitive)と不変条件(invariant) ## 目安の時間 - 27分 ## 感想・気づき - ドメイン・プリミティブ → 値オブジェクトに不変条件を加えたもの - RFCなどの現実世界の規格に沿うことは大事だが、その上で今回対象のドメインにおいて必要な制約は何かを考え続けなければいけない - メールアドレスの例もそうだし、のちにISBNから本IDに派生した話など。目的が変わるのであれば、それに応じたモデルを作っていく - > p170 値オブジェクトに関して特に重要な特徴は、不変であること・・・(略) - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959778959850090546) - エンティティもimmutableにすることができると思うが、皆さんがどういうルールで運用しているのか、気になった:+1::+1::+1: - > p171 ドメイン・プリミティブはドメイン駆動設計の値オブジェクトのようなものです。しかしながら、ドメインプリミティブはその中に不変条件を持ち、オブジェクトの生成時にその不変条件が確認される、という大きな違いがあります。 - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959778247120392273) - なるほど〜と言う気持ちでした。DDDの値オブジェクトも不変条件を持つと思っていたがそうではないのかな。DDDでいう値オブジェクトの不変条件はもしかして値オブジェクトの外側で実施されるイメージ?:+1::+1::+1::+1::+1::+1: - > p.175 この種の意味における軽微な違いはセキュリティの問題を引き起こす原因となりやすく、そのため、このような用語に異なる意味を持たせることは、他のシステムやドメインとのやり取りが発生する場合は特に、避けた方が良いでしょう。(図5.2) - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959797166757539872) - こういうの、最初コード書いた人にはシステム固有、世界標準いずれかの思いがあっても、名前にその意志が見えないと改修した人によって意図が混ざってしまうのはある話かな。わかりやすくするの大事。 :+1::+1::+1: ## 疑問 - > p170 値オブジェクトの「完結した概念」の脚注: 「概念的な統一体」と呼ばれるもので、対象の概念を表すのに必要な全ての要素を含んで1つの個となる物を形成した概念のことである - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959775560438005770) - 分かったようで分かっていない気がして不安になってきた、、、:+1: - 国際通貨を扱う場合は、「数字」と「通貨の種別」が完結した概念って認識でいいのかな??:+1: --- # 5.2 Read-Onceオブジェクト(一度しか読み込めないオブジェクト) ## 目安の時間 - 17分 ## 感想・気づき - 率直な感想としてRead-Onceオブジェクトを使って、想定していないところで利用をしていたことを検知する仕組みはとてもいいなって思った。:+1::+1::+1::+1::+1::+1::+1::+1: - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959784572801908746) ## 疑問 - Read-Once オブジェクトって、処理のリトライなどにはどう対処するのだろう。外からの通信に問題があったなどで、リトライしたくてももうデータが読めない?:+1::+1::+1: :+1::+1::+1: - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959782784191328326) --- # 5.3 ドメイン・プリミティブによってもたらされるセキュリティ ## 目安の時間 - 22分 ## 感想・気づき - > P.189 エンティティは本来課せられた処理の他に、データの妥当性や不変条件の確認などの責任も追わなくてはならなくなります。 - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959789216945025025) - 3.2.1節(エンティティの節)を見直すと以下のことが書かれている - エンティティは自分自身を特定できるようにする識別性を持っており、他のエンティティと区別できるようになっている - エンティティは自身が所有するオブジェクトの操作を調整する責務を有する - エンティティはあるライフサイクルにおいて一意に識別できる。状態を持てることに集中するという見方ができるので、自身が持っている値の妥当性確認は値オブジェクトに任せると、責務に集中ができることだと理解をした。:+1::+1: - > p.192 それでは、なぜ、コードを見る際に、この確証バイアスが影響してくるのでしょうか?まず、開発者が読むコードのほとんどは正しく実装されています。そのため、脳が「ここまでみてきたコードには今のところ問題ない」と認識してしまうと、無意識のうちに「残りのコードも同じく問題がないだろう」と思い込んでしまうわけです。 - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959789929162997810) - PRとかで確実に気づくの、無理。後続にあるコードの書き方も良いけれど、テストで気付きたい。 - 問題ないと思える環境って幸せだな〜。 - 複雑になると細部を簡単に見落としてしまう。心理学的要因にある。確証バイアス (confirmation bias) のような記述があったと思います。ありますよねぇ:+1: ## 疑問 - > ドメイン・プリミティブを使わない場合を見つけることが難しいくらいです。 - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959786489573670982) - クラスを新しく作ることにはどんな抵抗があるのだろうか?個人的にはパッケージ構造がざっくりしている時はそこから考える必要があるのでハードルの高さは感じる。:+1: :+1: - クラス(ファイル)増やすと管理が大変になるって言われたことあります(分岐とループだらけになってる) --- # 5.4 汚染解析(taint analysis) ## 目安の時間 - 22分 ## 感想・気づき - taint analysisというのは初見だったが、この手法の中で「コンストラクタにデータを渡していることは妥当性確認をしているよね」と汚染除去しているとみなしている。このことから、コンストラクタで妥当性確認をするドメインプリミティブの共通点があるよね、という話として受け取った。 - あまり汚染解析(テイント解析)についてはパッと検索してあまり出てこなかった:+1: - NTTの資料はあった - https://www.iwsec.org/mws/2012/presentation/1A1-1-slide.pdf - 汚染解析とは違うけれど、最近よくいうトレーシングとか含めてデータの流れを追うのに識別情報付与するのは一般的アプローチなのかもと思った。(目で追えない。。。) :+1:   - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959796234820919346) ## 疑問 - > p199 汚染ビットをつけることで、そのデータがシステムをどのように経由しているのかを追跡する点です。 - [discord](https://discord.com/channels/432531367427964929/911610565103845387/959793706104389632) - 汚染ビットを付与せずともデータ自体を追跡して、浄化(Validationなど)を実施した際にエラーとなることまで追跡できれば良い気もする、汚染ビットをつけてまで(一時的に)2重?でデータを保持することの利点があまり理解できなかった、詳しい方がいれば教えて欲しい :+1: ---

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully