• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to maintain a application?

 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, friends,
How to maintain a application? By changing it, or by extending it.
For example, how to change a controllor in mvc, extend a former one or change the former one?
If change the former one, I can set most of the methods private, If extend it I have to leave them protected

best
[ November 29, 2003: Message edited by: damu liu ]
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Damu,
I don't mean to be sarcastic, but the direct answer to this question would be like finding The Silver Bullet.
The degree of extensibility or changeability of an application/module is directly proportional to the quality of design.
Without going into OOD and Software engineering concepts for answer, I'll try to put it short. Even before you are designing a module (class/interface/a functional module), often you have to decide how much change you would allow in the module you are writing.
In my opinion, the behaviour of a module can be divided into
1. Private behaviour (definite candidate for private members)
2. Customizable behaviour (protected et al)
Unfortunately, I endup giving pretty convoluted answers all the time. Lemme know if you need clarification/resources for this (if this made sense @ all)
Dushy
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, Dushy
I want to know if you want to add some new function to the GUI, what will you do, change it or extend it?
Best,
Damu
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Damu,
My answer: yes.
Whether to modify or extend any class is dependant on a number of things. Some of them might be:
  • Will modifying it break any existing classes that use it?
  • Are there any classes that might want only the old functionality?
  • Will modifying it change it's "one responsibility"?
  • Do I have complete ownership of the class to modify it?
  • Will there be any benefit in having original code in one class, and my code in a separate class?


  • That is all just from the top of my head. There are no doubt other things that you might want to consider. But that gives you some ideas of the things I would consider before I could decide whether to modify or subclass code.
    Is this related to your SCJD assignment?
    Regards, Andrew
     
    Bigwood Liu
    Ranch Hand
    Posts: 240
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thank you Andrew,
    My answer: yes.
    I am wondering what access limit should the m-v-c members have. If there are some new functions would be added to GUI, we have to consider this question. Extends it or cahnges it. If extends it, we have to give the members more loose access limit thus the subclass can access it, or if change it, we can give the members more strict access limit.
    If the answer is yes , we have to value it carefully. How do you think?
    Best,
    Damu
    [ December 01, 2003: Message edited by: damu liu ]
     
    You showed up just in time for the waffles! And this tiny ad:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic