タグ

classに関するlemonjpのブックマーク (4)

  • How do I design a class in Python?

    I've had some really awesome help on my previous questions for detecting paws and toes within a paw, but all these solutions only work for one measurement at a time. Now I have data that consists off: about 30 dogs; each has 24 measurements (divided into several subgroups); each measurement has at least 4 contacts (one for each paw) and each contact is divided into 5 parts and has several paramete

    How do I design a class in Python?
  • PHPのDIで動的にオブジェクトを確保する考察

    Dependency InjectionがPHPでも流行っているそうです。が、未だによくわからないので、わからないところを自分なりに考察してみます。 ※DIコンテナではなくデザインパターンとしてのDIを考えます。 Dependency Injectionとは Dependency Injectionはデザインパターンの一種です。日語なら依存性の注入と訳されます。「Inversion of Control コンテナと Dependency Injection パターン」が原典でしょうか。 ざっくり要約すると「クラスの中でnewしてはいけない。必要なインスタンスは外から突っ込むべし」というところかな。 class Y { private $x; function __construct() { $this->x = new X; } //...$xを使ったコード色々... } 上記のYクラス

    PHPのDIで動的にオブジェクトを確保する考察
  • http://e0166nt.com/blog-entry-862.html

    http://e0166nt.com/blog-entry-862.html
  • クラス

    クラスを生成する クラスを定義する クラスは、※プロパティ(メンバ変数)と※メソッドから構成されます。プロパティ=変数、メソッド=関数と考えると分かり易いかもしれません。 クラスの定義には、classというキーワードを使用し、続けて定義するクラス名を指定します。クラス名を指定したら、そのクラスのプロパティ(メンバ変数)と、メソッドを定義します。 ※プロパティ(メンバ変数)とは・・・ クラスで表現したいオブジェクトの「パラメータ」を格納するための変数にあたります。例えば、私たち「人間」をクラスとすると、「性別」、「年齢」、「血液型」がプロパティにあたります。 ※メソッドとは・・・ 機能を実現するための関数にあたります。メソッドは一般の関数とは異なり、あくまでクラスのオブジェクトの中でのみ有効になります。例えば、私たち「人間」をクラスとすると、「べる」、「走る」、「寝る」がメソッド

  • 1