[sip-comm-dev] Resources, ImageID


#1

Well... it's probably yet another one of my nagging questions but I'm
desperately trying to implement a ConfigurationForm and I just cannot
get my head around all the details.

There are 28 classes named Resources (in the SIP Communicator code
base) which are pretty much the same (including the warnings about
unused imports, the extra line between the license comment and the
package name). Will it be a problem to replace them with a single
class? I'm asking in case I'm missing some future extensibility plans,
just anything to justify their existence (other than leftovers from
past refactorying).

Then there are 16 ImageID classes which are totally identical and do
nothing but wrap a String. Can they be removed? I mean if we're
accessing String resources using a String key, why do we need to
access Image resources using ImageID keys...

Thanks a lot,
Lubo

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Lubomir Marinov wrote:

Well... it's probably yet another one of my nagging questions but I'm
desperately trying to implement a ConfigurationForm and I just cannot
get my head around all the details.

There are 28 classes named Resources (in the SIP Communicator code
base) which are pretty much the same (including the warnings about
unused imports, the extra line between the license comment and the
package name). Will it be a problem to replace them with a single
class? I'm asking in case I'm missing some future extensibility plans,
just anything to justify their existence (other than leftovers from
past refactorying).

Then there are 16 ImageID classes which are totally identical and do
nothing but wrap a String. Can they be removed? I mean if we're
accessing String resources using a String key, why do we need to
access Image resources using ImageID keys...

Sounds good to me. Why not copy the individual classes that you like best and then clean up (and improve?) the new refactored ones? (i.e. leave the old ones in place and ugly for now). Any new code you write should use the new versions straight away.

If you don't have time, I'll try to write some new self-contained jUnit tests to prove they are correct - just to get some meaningful examples for my new non-felix unit test framework. If you are going to replace many classes with common ones, we need a strong set of unit tests to prove there is no regression after future changes.

Once they are being thoroughly tested by every build, anyone can start the process of eliminating the individual redundant duplicate classes and relying on the new common ones.

Good luck!

Brian

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Lubo,

Lubomir Marinov wrote:

Well... it's probably yet another one of my nagging questions but I'm
desperately trying to implement a ConfigurationForm and I just cannot
get my head around all the details.

There are 28 classes named Resources (in the SIP Communicator code
base) which are pretty much the same (including the warnings about
unused imports, the extra line between the license comment and the
package name). Will it be a problem to replace them with a single
class? I'm asking in case I'm missing some future extensibility plans,
just anything to justify their existence (other than leftovers from
past refactorying).

actually there already exists a ResourceService, which regroups all these and the fact that we didn't clean up everything is because we didn't have the time at the moment. Also there's still some ongoing improvements on the resources management and the "great" clean up could come after that I think. For now you could use the ResourceService and there's no need to make another Resources class.

Then there are 16 ImageID classes which are totally identical and do
nothing but wrap a String. Can they be removed? I mean if we're
accessing String resources using a String key, why do we need to
access Image resources using ImageID keys...

I could not say yes for all of them, because I think I still want to keep it in the gui package. However it's probably senseless to have an ImageID class in a plugin that access 2-3 images.

Cheers,
Yana

···

Thanks a lot,
Lubo

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net