2011/08/19

住所class 設計

とある日に住所をオブジェクト指向設計したらどうなるという議論がありました。

  • ある人は、以下があるといいました。
  1. 都道府県クラス
  2. 市区町村クラス
  3. 番地クラス
  • ある人は、以下があるといいました。
  1. 住所クラス
  • ある人は、クラスではなくフィールドもしくはプロパティだといいました。
  1. 文字列

    その時の議論では答えは出なかったと思います。

    今、思い返すと自分の回答は「場合による」になります。
    何が場合によるかというと以下になると考えるからです。
    • 住所をどのように使用するかによって違ってくる。
    表示目的で特に機能を有しない場合
    フィールドもしくはプロパティにする
    class Contact
        string address;
    }
    

    それぞれに於いて機能が付加されるような場合
    都道府県、市区町村、番地クラスを使用する
    class Todoufuken
    {
        Todoufuken(string name);
        number getArea(); //面積取得
    }
    

    住所に機能が付加されるような場合
    住所クラスにする
    class Address
    {
        Address(string address);
        string getTodoufuken( string address );
        Todoufuken getTodoufuken( string address );
        string getPostNumber(string adress);
    }
    
    or
    class AddressHelper
    {
        static string getTodoufuken( string address );
        static Todoufuken getTodoufuken( string address );
        static string getPostNumber(string address);
    }
    

    というように、場合によって目的のクラスを後々付加していくのがいいと思う今日この頃。

    1 件のコメント:

    1. To determine KoNLPy and its options for the experiment, representative KoNLPs such as okt, mecab, hannanum, and kkma, nicely as|in addition to} the RF algorithm with every possibility, were chosen for this research. From the subsequent experiment, okt and mecab were used to consider about|to contemplate} their efficiency and velocity. Fattahi and Mejri utilized natural language processing techniques, namely, Bag of Words and Term Frequency-Inverse Document Frequency (TF-IDF) to establish spam SMSs 카지노사이트 . Choudhary and Jain utilized random forest classification algorithms . Various machine studying models have additionally been utilized to detect and classify malicious URLs . Yan et al. proposed an unsupervised studying algorithm that trains URL embedding models, an approach that far exceeded the efficiency of other algorithms corresponding to SVM, DT, LR, NB, and CNN.

      返信削除