• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

NX: What functions to submit

 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the contractors project and as most of you know you have
to provide delete, update, new and find in you data class even though they do not appear on the gui. For testing purposes I placed buttons on the gui and made them (delete, update...) fully functional (so in other words they were part of my DBClient interface and my gui controller has these methods). Now, I know I should remove the buttons from the gui, but should I take out the methods in my DBClient interface class and my Controller class and have them only in the Data class. Or should I
leave them in?
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,
I would leave the methods in. Part of my requirement states that the "interface should be designed with the expectation of future functionality enhancements [...]". I'd go as far as keeping the buttons on the interface and throwing a checked exception to specify that the feature is not implemented yet. This way, when the feature becomes available there is no need to re-compile the client code. It just gets activated.
It's a crazy idea, I'm not even sure I'd implement it but we are discussing possibilities...
Adrian
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMO, I dont think the buttons should be on the interface. If the logic behind the button is not to be used, then I don't think they should be there. Think how confusing that would be to a user. But should the code
behind them remain everywhere else? Thats my big concern.
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,

But should the code behind them remain everywhere else? Thats my big concern.


I would'nt keep the unused code. I you do, you'll have to document it. Moreover, you've still the risk that something is wrong with it.
Best,
Phil.
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I would'nt keep the unused code. I you do, you'll have to document it. Moreover, you've still the risk that something is wrong with it.


Yes I thought of this but I have tested them from the gui extensively and
have put a lot of time to make sure my gui controller and DBAdapter
can handle them. Plus, I don't think they will ever use them but
it least shows I am thinking about future upgrades. On the downside
its more code that a "novice programmer" has to hash through.
What do you think?
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,
Just noticed you added temporary GUI buttons to your app to test the "unused" create/delete operations of the DB object-- have you tried using the JUnit framework to write test cases for these operations instead? Helps you create confidence-building tests while keeping them out of your main codebase, so you can just leave the test code out at the end when you make your final distribution.

Paul
[ November 03, 2003: Message edited by: Paul Tongyoo ]
[ November 03, 2003: Message edited by: Paul Tongyoo ]
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I have done that. But even JUnit has some wholes in it in regards
to taking an action all the way through from GUI, to Controllre, to Adapter
and finally Data. I think I have decided I will leave the functions in
and place them at the bottom of each class that uses them and document
why they are still there. This way they are out of the way of the main
code but there are they are there to show I took serious consideration
into future upgrades.
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,
It looks like a good tradeoff.
Best,
Phil.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic