2

私はプログラムを書いていますが、1 つのオブジェクトが単数形になり、コレクションが複数形になるオブジェクトをたくさん作成しているようです。例えば

セールスグループセールスグループ

これは、他のプログラマーが私のコードを読むのを混乱させますか?

4

4 に答える 4

2

should not be confusing, in fact I find it pretty informative and clear; unless you have multiple kinds of collections (lame example: suppose you have an array but also a map of SalesGroup, then SalesGroups would not be the best choice but you'd rather pick SalesGroupArray, SalesGroupMap etc.)

于 2009-11-08T19:26:14.150 に答える
2

I think that makes perfect sense. Not specifying the type of collection means you're at liberty to change the implementation later, and clients can't rely on a particular implementation.

于 2009-11-08T19:28:35.637 に答える
0

紛らわしいわけではありませんが、見逃しやすいと思います。これをやっていたら、もっと目立つものを使うと思いSalesGroupますSalesGroupCollection

于 2009-11-08T20:05:43.650 に答える
0

私にはOKのようです。プロジェクト全体でコーディング スタイルを維持するだけです。

于 2009-11-08T19:38:08.770 に答える