Skip to main content
added 200 characters in body
Source Link

I do not see the reason of for class OggConverter as it is now.

Instead of that you could just add the interface IConverter to class Ogg. And remove all others classes as then only forward the call.

IConverter converter = OggConverter(Ogg(file1,file2));

If we add the interface to Ogg

IConverter converter = Ogg(file1,file2);

I also do not see the reason for class AudioConverter, beside that it can store the ref to IConverter but we can store this reference in other place.

In addition to improve are those CODEC and FORMAT string constant. Instead of string constatns you shuld provide enumerations.

public enum AudioCodec {
  LIBVORBISLIBVORBIS;
}


public enum AdioFormatAudioFormat {
 OGG("ogg"),
 MP3("mp3");

private final String ext; 

private AudioFormat(String ext) {
  this.ext = ext;
}


public String getExt() {
   return this.ext;
 }
}

I do not see the reason of for class OggConverter as it is now.

Instead of that you could just add the interface IConverter to class Ogg. And remove all others classes as then only forward the call.

IConverter converter = OggConverter(Ogg(file1,file2));

If we add the interface to Ogg

IConverter converter = Ogg(file1,file2);

I also do not see the reason for class AudioConverter, beside that it can store the ref to IConverter but we can store this reference in other place.

In addition to improve are those CODEC and FORMAT string constant. Instead of string constatns you shuld provide enumerations.

public enum AudioCodec {
  LIBVORBIS
}


public enum AdioFormat {
 OGG
}

I do not see the reason of for class OggConverter as it is now.

Instead of that you could just add the interface IConverter to class Ogg. And remove all others classes as then only forward the call.

IConverter converter = OggConverter(Ogg(file1,file2));

If we add the interface to Ogg

IConverter converter = Ogg(file1,file2);

I also do not see the reason for class AudioConverter, beside that it can store the ref to IConverter but we can store this reference in other place.

In addition to improve are those CODEC and FORMAT string constant. Instead of string constatns you shuld provide enumerations.

public enum AudioCodec {
  LIBVORBIS;
}


public enum AudioFormat {
 OGG("ogg"),
 MP3("mp3");

private final String ext; 

private AudioFormat(String ext) {
  this.ext = ext;
}


public String getExt() {
   return this.ext;
 }
}
Source Link

I do not see the reason of for class OggConverter as it is now.

Instead of that you could just add the interface IConverter to class Ogg. And remove all others classes as then only forward the call.

IConverter converter = OggConverter(Ogg(file1,file2));

If we add the interface to Ogg

IConverter converter = Ogg(file1,file2);

I also do not see the reason for class AudioConverter, beside that it can store the ref to IConverter but we can store this reference in other place.

In addition to improve are those CODEC and FORMAT string constant. Instead of string constatns you shuld provide enumerations.

public enum AudioCodec {
  LIBVORBIS
}


public enum AdioFormat {
 OGG
}