• Post Reply Bookmark Topic Watch Topic
  • New Topic

General design question

 
Kevin Hamrick
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might be a stupid question but...
I've build a few sortable test table applets for a page that I am programming. The tables are rather long-about 500 lines of code because they are sortable. The tables seem to be doing everything I want. Now I have built the rest of the page and I am thinking that it might be best to tweak the table applets into a class that has a function which will return the sortable tables. The I should only have to instantiate the class and add the tables to the main page. I wanted to do this for readability sake. Is this a good idea?
 
Lionel Badiou
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Kevin,

That sounds correct. Readability and encapsulation are always good ideas though you may access your sorted tables through static methods (no instance needed + could be more readable in your case).

Best regards,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!