Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Refactoring the Legacy java code  RSS feed

 
kri shan
Ranch Hand
Posts: 1487
  • 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: 1487
  • 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: 1487
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any update ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!