Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comment on public method

 
kevin chang
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on writing my comments , i do know i should write comments on public and protected methods. But i am wandering about follows:

and follows:

MyTableModel is an inner class
should i also write comments on this class and it's public methods?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"MyTableModel is an inner class"
Why? Don't you want your TableModel to be reusable? It can't be if it's an inner class.
You get to decide, but you will want to JavaDoc this class too.
Mark
 
kevin chang
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that mean i'd better make a new file named MyTableModel.java and move MyTableModel class to that file? then it can reuseable.
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better than make the TableModel as an inner class in your client view code, The JTable applys the MVC architecture, too, it seperates the data management from data display, so I think it's better make your TableModel seperate from your client view code.
Frank
 
kevin chang
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi , but in MVC design pattern , i wonder where should i put this MyTableModel class, db or client? any suggestiong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic