Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refactoring the Legacy java code

 
kri shan
Ranch Hand
Posts: 1462
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This Legacy class has two inner classes. It it good practice to use inner classes ? I am planning to refactor into more reusable one. Because inner classes are tightly coupled. I am plainning to put general stuff in Base class(Parent class) and specific stuff in Derived class(Child class) for reuability of general stuffs. Is it right approach or any specific design pattern ?


Public class A {

Class B {
// variable declarations
}


Class C extends Observer and implements ExceptionListener {

}


Class D extends Observer and implements MessageListener {

onMessage() {

}
}

// calls Class C and class D methods

}

 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please describe the "objects". What will the "objects" do and what purpose will they serve? This information is required to accurately determine how to structure the "classes".
 
kri shan
Ranch Hand
Posts: 1462
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Objects are sending JMS messges to Middleware/MOM/ Messaging Broker produts.
 
kri shan
Ranch Hand
Posts: 1462
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any update ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic