This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Help with reusing code from a Singleton class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Help with reusing code from a Singleton class" Watch "Help with reusing code from a Singleton class" New topic
Author

Help with reusing code from a Singleton class

Karen Gomes
Ranch Hand

Joined: Aug 25, 2003
Posts: 60
Hello,

I have a SingletonClass1 in one project of which some features I reuse in a 2nd project.

SingletonClass1:
some common methods
some common attributes
other methods/attributes

SingletonClass2:
some common methods from SingletonClass1
some common attributes SingletonClass1
other methods/attributes

However since I cant inherit from Singletonclass1, how do I resolve this issue? I can set Project1 as a dependency/library in project2.
So I wan to reuse this SingletonClass1.

I can refactor this code, however lot of code in Project1 and other projects use this SingletonClass1. So I want to make sure I use the best approach here.

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with reusing code from a Singleton class
 
Similar Threads
Can some one please explain why do i need MAVEN here
RAD6 - Web Library Projects
Sharing External Jar files between projects
Why reuse doesn't happen
problem with jar file