开发者

class hierarchy design - order of classes

开发者 https://www.devze.com 2023-04-10 10:46 出处:网络
What is the best way to order a a group of classes.I\'ve already made the decision to put them in one file.An opcode caching application well ensure efficiency.

What is the best way to order a a group of classes. I've already made the decision to put them in one file. An opcode caching application well ensure efficiency.

Is alphabetical O.K? Does it matter? Here is the list.

/*CLASS LIST*/

  /*bookm开发者_开发问答ark*/
  /*database*/
  /*import*/
  /*one_db*/
  /*post*/
  /*route*/
  /*session*/
  /*signup*/
  /*table_maintain*/
  /*tweet*/
  /*upload*/
  /*validate*/
  /*view_html*/


Classes like "one" and "tablem" seem to be a bit confusing. When someone looks into your application, even first line of class has to tell him/her, what does it do, what is that class for.


You need to put parent classes before child classes. So alphabetical with classes moved to take into account parent/child relationships.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号