タグ

Golangとpatternに関するy_yukiのブックマーク (3)

  • GitHub - jbuberel/go-patterns

    Go Examples of Common Patterns This is a collection of common design patterns translated into Go. The goal of this repository is to help programmers coming from other language communities understand how their favorite patterns can be reused in Go. We do not intended to be restrict this to the traditional GoF Design Patterns. We hope to include any language idiom you'd like to see re-implemented in

    GitHub - jbuberel/go-patterns
  • Google Sites: Sign-in

    Not your computer? Use a private browsing window to sign in. Learn more

  • Go言語での構造体実装パターン

    Go言語での構造体実装は、埋込や独自コンセプトのインターフェースといったGo言語独自の機能を理解して行う必要があります。 今年からGo言語を始めましたが理解が曖昧なままだと実装に迷うことが何度かありました。今回よい機会なので、Go言語での構造体実装パターンとしてまとめてみることにしました。 構造体実装パターン 実装パターンの洗い出しとして、GoFデザインパターンをGo言語で実装する手法をとりました。 その中で繰り返し現れる実装をGo言語での構造体実装パターンとしてまとめてみました。 コンストラクタ関数 エクスポートによるアクセス許可 インターフェースによるポリモフィズム 構造体によるポリモフィズム 構造体によるサブクラス・レスポンシビリティ 構造体による移譲 関数による移譲 以下、それぞれのパターンを解説していきます。 コンストラクタ関数 Go言語には構造体のコンストラクタがないため、構造

    Go言語での構造体実装パターン
  • 1