Adding new feature without recompiling

i have a question
i have this program in java that translates one language to another now i want to be able to add another translator later if i required at runtime without recompiling the whole thing.that is i should have the provision of adding new translators feature which i dont know now about, later without compiling.
if anybody could guide me i will really appreciate that
thanks

A factory might do the job if you've organized your existing code properly.
Assume an interface exists:public interface Translator {
   public String translate(String text);
}Also suppose you already have a single translator:package my.package;
public class EnglishToDutchTranslator implements Translator {
   public String translate(String text) {
      return translation;
}Store this fact in a .properties file or preferences or whereever:ENDU= my.package.EnglishToDutchTranslatorHere's the factory:public final class TranslatorFactory {
   // contains the above name -> tranlator class name mappings
   private static Properties translators;
   // don't instantiate this class
   private TranslatorFactory() { }
   public static Translator getTranslator(String name) {
      String clazz= translators.getProperty(name);
      if (clazz == null) return null;
      try {
         return (Translator)Class.forName(clazz).newInstance();
      catch (Exception e) {
         e.printStackTrace();
         return null;
}Basically all the factory does is 1) get the fully qualified class name
given the name of the translator and 2) instantiate an object from that
class. All that it cares about is that the object implements the Translator
interface. You can build new translators and register them in that
properties file. A caller should get a translator as follows:Translater t= TranslatorFactory.getTranslator("ENDU");kind regards,
Jos

Similar Messages

  • Adding new Feature in already deployed package

    Hi!
    Please consider the following scenario:
    I have a SP Project that contains a Package and a Feature. This package has been deployed and the feature has been activated already in a farm. Now I want to add a new Feature in the existing package and redeploy it in order to activate the new feature
    without affecting the old one.
    I'm using Update-SPSolution to update the package in the farm but it seems that the new feature does not appear in the list of features of the sites. I read this
    http://sharepoint.stackexchange.com/questions/45675/how-do-i-update-an-already-existing-wsp-on-farm which suggests that if I want to add a new feature I need to uninstall and reinstall the package. But if I do that the old feature will be deactivated which
    means that data will be lost!
    Isn't there any other way?
    Dimitris Papadimitriou, Software Development Professional

    Try running
    Install-SPFeature manually and check. The feature folder would be available on all servers since it was part of the solution.
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Adding new users without restarting? OC4J (v9.0.2 prod)

    Hi all,
    Is it possible adding new customers using the
    jazn.jar utility and use them without having
    to restart the OC4J server?
    Regards,
    Giovanni

    This forum is for feedback about the OTN site, not for technical questions.
    Here is a link to the OC4J forum:
    OC4J

  • Dear Adobe, it's great you keep adding new features, but what about ...

    Dear Adobe,
    It's great you keep adding shiny new "newsworthy" features ... but what about fixing long-standing bugs/issues and addressing the basics that have been missing since the the beginning?
    WHAT ABOUT LEAVING PASTED CLIPS SELECTED after a Paste operation in the Timeline?!? Like every other app in the world?
    What about leaving a complex selection of clips intact after an UNDO operation? (This costs me hundreds of minutes a week.) Like every other app in the world?
    What about allowing "." as an abbreviation for "00" when entering timecode?
    What about letting the renaming of a clip in a bin be reflected in timelines?
    What about a "reduce project" option? (To remove all items not used by selected sequences, like Ae.)
    What about actually useful clip labels (colors) which link between timeline items and their respective clips in the bin? (Like Avid & FCP) So we can mark certain clips a certain color in a bin and have that color be reflected in timelines?
    What about being able to close the title tool with a shortcut, not just a tiny 4x4 button?
    What about fixing the title tool so it's kerning/leading shortcuts are NOT the exact opposite of EVERY OTHER CC application?
    What about a simple "Select Media Relatives" command, like in FCP and Avid?
    What about fixing the audio scrub toggle shortcut so that it works without having to play or use the mouse?
    What about a shortcut for "Reveal in Finder" from the Timeline? It's in the context menu -- why no shortcut?

    I am curious about the time you waste ...and wonder what and why you are doing it... that causes this loss of efficiency.
    2. What about leaving a complex selection of clips intact after an UNDO operation? (This costs me hundreds of minutes a week.) Like every other app in the world?
    Maybe  there is a better way !

  • Adding new peer without removing cmap from interface.

    I have a frustrating issue with a dynamic VPN head end running IOS 15.2 on 2900's. I have existing keyrings, and isakmp profiles (both main and agressive) running. When I add in a new peer, by adding in a keyring prechared statement and a match identity in the isakmp profile, phase 1 biulds but phase 2 only gets right to the end and the Cisco side resets the connection because it did not get back a response to it's Phase 2 proposal.
    I have tried a number of soft clear commands to remedy this (I do have 16 other production tunnels I do not want to take down) and no avail. This is very consistent. We had this happen last week in the same manner, and the TAC finally said I must reboot the system. So I removed the cmap from the interface, and reapplied it (using notepad to do it all at once). All the tunnels dropped, and after a few manual restarts on the far end for thos etunnels that are tempermental, all tunnels came back up, including my new add.
    I have a pair of 3900's running 15.1 code in the US that terminate the same tunnels, and I can add and remove PEERS all day long without resetting anything. Has anyone one encountered this before? Could there be a more polite way of resetting what ever it is that removing the CMAP does to allow my new peer to get the full treatment here?
    (I am not asking for VPN peer config help, as I know this tunnel template I am using works, but if you want to see it)
    Nick
    crypto pki token default removal timeout 0
    crypto keyring Site-to-Site 
      pre-shared-key address a.a.a.a key lkdshjfhjkdsfkjfsjkddedswdes
      pre-shared-key address b.b.b.b key lkdshjfhjkdsfkjfsjkddedswdes
      pre-shared-key address c.c.c.c key lkdshjfhjkdsfkjfsjkddedswdes
      pre-shared-key address d.d.d.d key lkdshjfhjkdsfkjfsjkddedswdes <- old sonicwall VPN KEY
      pre-shared-key hostname BOB key lkdshjfhjkdsfkjfsjkddedswdes
      pre-shared-key hostname BILL key lkdshjfhjkdsfkjfsjkddedswdes
      pre-shared-key hostname JILL key lkdshjfhjkdsfkjfsjkddedswdes
    crypto keyring Site-to-Site_PAN 
      description Keyring used for AES256 Palo Alto config, using IP's
      pre-shared-key address e.e.e.e key uiopadsbfjkahfga;lkdj
      pre-shared-key address f.f.f.f key uiopadsbfjkahfga;lkdj
      pre-shared-key address d.d.d.d key uiopadsbfjkahfga;lkdj <- my new add for Palo
    crypto isakmp policy 5
    encr aes 256
    hash sha256
    authentication pre-share
    group 2
    lifetime 28800
    crypto isakmp policy 10
    encr 3des
    authentication pre-share
    group 2
    lifetime 28800
    crypto isakmp policy 20
    encr aes 256
    authentication pre-share
    group 2
    lifetime 28800
    crypto isakmp policy 30
    encr aes
    authentication pre-share
    group 2
    lifetime 28800
    crypto isakmp invalid-spi-recovery
    crypto isakmp keepalive 60 3 periodic
    crypto isakmp nat keepalive 20
    crypto isakmp profile Site-to-Site-Main
       keyring Site-to-Site
       self-identity user-fqdn ASIA
       match identity address a.a.a.a 255.255.255.255
       match identity address b.b.b.b 255.255.255.255
       match identity address c.c.c.c 255.255.255.255
       (Removed SonicWall peer match for d.d.d.d)
       keepalive 60 retry 3
    crypto isakmp profile Site-to-Site-Aggressive
       keyring Site-to-Site
       self-identity user-fqdn ASIA
       match identity user-fqdn BOB
       match identity user-fqdn BILL
       match identity user-fqdn JILL
       keepalive 60 retry 3
       initiate mode aggressive
    crypto isakmp profile Site-to-Site-Aggressive_PAN
       keyring Site-to-Site_PAN
       self-identity address
       match identity address e.e.e.e 255.255.255.255
       match identity address f.f.f.f 255.255.255.255
       match identity address d.d.d.d 255.255.255.255 <- My new add
       keepalive 10 retry 3
       initiate mode aggressive
    crypto ipsec transform-set CSC-TS1 esp-3des esp-sha-hmac
    crypto ipsec transform-set CSC-TS2 esp-aes 256 esp-sha-hmac
    crypto ipsec transform-set CSC-TS3 esp-des esp-md5-hmac
    crypto ipsec transform-set CSC-TS4 esp-aes esp-sha-hmac
    crypto ipsec transform-set CSC-TS5 esp-aes 256 esp-sha256-hmac
    crypto dynamic-map CSC-DMAP 5
    set security-association lifetime kilobytes disable
    set security-association lifetime seconds 28800
    set transform-set CSC-TS5
    set reverse-route distance 240
    set reverse-route tag 240
    set isakmp-profile Site-to-Site-Aggressive_PAN
    reverse-route
    crypto dynamic-map CSC-DMAP 10
    set security-association lifetime kilobytes disable
    set security-association lifetime seconds 28800
    set transform-set CSC-TS1 CSC-TS2 CSC-TS3 CSC-TS4
    set reverse-route distance 240
    set reverse-route tag 240
    set isakmp-profile Site-to-Site-Aggressive
    reverse-route
    crypto dynamic-map CSC-DMAP 20
    set security-association lifetime kilobytes disable
    set security-association lifetime seconds 28800
    set transform-set CSC-TS1 CSC-TS2 CSC-TS3 CSC-TS4
    set reverse-route distance 240
    set reverse-route tag 240
    set isakmp-profile Site-to-Site-Main
    reverse-route
    crypto map CSC-CMAP 20 ipsec-isakmp dynamic CSC-DMAP
    interface G0/0
    crypto map CSC-CMAP redundancy dmzvpn <-- I just negate this and re-add and new peers start working.

    This is where the connection sits...
    show crypto session detail
    Interface: GigabitEthernet0/0
    Profile: Site-to-Site-Aggressive_PAN
    Session status: UP-IDLE
    Peer: d.d.d.d port 4500 fvrf: (none) ivrf: (none)
          Phase1_id: d.d.d.d
          Desc: (none)
      IKEv1 SA: local 192.168.221.2/4500 remote d.d.d.d/4500 Active
              Capabilities:DN connid:1473 lifetime:07:31:02

  • Adding new ringtones without resyncing...

    Is there a way to add new items such as ring tones without having to re-sync all the information on the iPhone. My desktop computer crashed a month ago so my iTunes music library went along with it. When I tried to add new ring tones it asked me if I want to erase all data and re-sync on my laptop. I really love the music that I have on my iPhone so erasing it is not a choice. I can live without the ring tones but it would be nice to have some because factory ring tones get pretty boring. Is this possible?

    Doesn't seem like you can do it.
    However, there might be a way : first get your music back to whatever computer you have right now. Then you can sync again with out any problem.
    I remember there was post show you how to do it; don't know how to insert link to that post, but here is what it says
    " if you have music or video on the iphone that you have purchased from the itunes store, you can copy this back to the computer. To do this, open itunes and at the top click on store and choose authorize computer. Put in your account name and password in the alert that comes up and choose authorize. Once the computer is authorized, connect your iphone. Once itunes shows your iphone, click on file at the top of itunes and choose transfer purchases from...
    This will copy any purchases that you have on the iphone back to the computer.
    However, if the music was copied from cd or other locations, it will have to be reimported into itunes.
    Hope this helps. "
    Hope the author of this post don't mind when I share this with you.

  • Who's in Charge? What needed fixing and/or new feature added?

    Having been a software development engineer and manager for over 20 years and a Mac Evangelist since 1984, I have been very disturbed by the GUI changes that Apple has made to the OS X over the past 5 years.
    There appears to have been an invasion of Microsoft SW programmers into the Mac OS X systems SW department.
    Any change to an established GUI should be a very critical concern of any Software Manager and only done to fix a major error or to add new features, which should not impact GUIs for current features.
    The most costly investment a user makes in any software is in the user training to become productive in its use.  This is where the GUI makes or breaks the user experience and his decision to continue its use or toss it and replace it with another app with a more familiar and user friendly GUI.
    When Apple makes changes to the GUI with no apparent benefit except that some rogue programmers decided they didn't like the old way and wanted to "make it their own", it costs the user community literally hundreds of thousands of hours in lost time adjusting the the new GUI without any added benefit and it creates frustration and disappointment with the app. It also creates a sense of betrayal and fear that other unneeded changes to the GUI will follow with more lost time.
    There should be a strictly controlled change control process when any contemplated GUI change is being considered.  A change request must be created and thoroughly reviewed especially with the impact on users being the foremost consideration.  When new features are added, the GUI should be consistent with the current feature GUI as much as possible.  Obviously, when a released feature's GUI proves to be cumbersome and unproductive, it should be revised. But revised only to minimum extent required. When a new GUI for current features can be justified based on consistency, improved productively and/or accuracy, then an option should be provided to current users to revert to the old GUI if they choose to for at least 1 or 2 releases/updates.
    GUI changes should be beta tested by a broad base of REAL users before being released.  REAL users should be heavily weighted to LONG time users and not just based on younger, inexperienced users with very little investment in time relative to the current GUI.
    In GUI software, change for change's sake should be quickly stopped and denied approval for implementation.  Yosemite is a classic example of how not to upgrade software.  It obviously was not very well tested before release. The SW QA dept should be replaced.  The SW Engineering Manager should be fired for approving a Software Specification and GUI Specification that was Yosemite.  Did anyone on the SW Engineering Development team have ANY experience using Mac OS X?  Mavericks was a significant change from Mountain Lion but it was still recognizable as a Mac OS.  Yosemite looks like a rejected Windoze OS release.
    Being an Apple shareholder and a Mac Evangelist since 1984 (even had a Lisa in 1982!) I am deeply concerned that Apple is loosing it's way.
    A user friendly, well tested GUI used to be Apple's strong point and is what created a loyal user base. Let's hope Apple does not lose sight of their best product discriminator.

    You are not addressing Apple here. This is a user to user support forum. If you want to let Apple know how you feel about something, then use the feedback page HERE, and then click on the appropriate subject.
    Sorry, it was a typo, but stedman1 has provided you a good one.

  • Visual Studio 2013 is creating new feature every time new list definition is added

    We are using Visual Studio 2013 and details are as under:
    Microsoft Visual Studio Ultimate 2013
    Version 12.0.30501.00 Update 2
    We we add a new list definition in our project, it creates a new feature with it. If we delete the feature and add list definition in the existing feature, list is created but columns are not added in the list.
    Same thing happened if we rename "Feature1", a new feature is created every time a new list definition is created.
    This doesn't happen when we add a Visual WebPart.
    Also, we have three different custom list option in the drop down in new list creating wizard.
    Is this a bug or we are doing something different.   
    http://farhanfaiz.wordpress.com

    Intellisense has a bug in VS2013 where it doesn't recognize InitializeComponent when you start working on the XAML.  My feeling is that if you try to compile this app, it will run fine (as long as there are no actual errors).
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • New features added, old features removed

    I've seen many users who has asked why the new firmware removed some good features and so on... So I have this thread, and hope that answer you all.
    the phone ROM is basically fix, say 128MB ROM and the available ROM for user is 44MB (say in the spec or manufacturer's spec) which means 84MB is used for the ROM.
    So if a new feature is added then they have to remove or shrink something to maintain that 44MB available for users as the spec.
    Also bugs and problem fix could cause the increment of ROM... unless it's extra install file or patches (which also takes up some space either in ROM or memory card)
    Cheers

    I've seen many users who has asked why the new firmware removed some good features and so on... So I have this thread, and hope that answer you all.
    the phone ROM is basically fix, say 128MB ROM and the available ROM for user is 44MB (say in the spec or manufacturer's spec) which means 84MB is used for the ROM.
    So if a new feature is added then they have to remove or shrink something to maintain that 44MB available for users as the spec.
    Also bugs and problem fix could cause the increment of ROM... unless it's extra install file or patches (which also takes up some space either in ROM or memory card)
    Cheers

  • Where can I download lightroom 6, but NOT LR 6 CC? Only the new LR6 without any cloud features. Thanks!

    Where can I download lightroom 6, but NOT LR 6 CC? Only the new LR6 without any cloud features. On the dowloadsite I find only CC-downloads.
    Thanks
    Martin

    Hi Martin,
    Please follow the steps given in the article.
    Adobe Photoshop Lightroom Help | Serialize Lightroom CC trial to activate as Lightroom 6
    Hope this helps.
    Regards,
    Sumit Singh

  • HT201087 Why can't I add a location to a photo in the new Photos app?  Apple appears to have taken away a feature without asking.

    Why can't I add a location to a photo in the new Photos app?  Apple appears to have taken away a feature without asking. 

    I have an iPhone and occasionally use it for photos, but my main camera is NOT an iPhone.  To be forced to go outside Apple for a product when Apple had perfectly good products available is ludicrous.  But it is what it is, apparently.

  • HT4527 I set up my iphone with my laptop but now its broken is there anyway of adding new song using anpther laptop/desktop computer without erasing everything currently on my phone?

    I set up my iphone with my laptop but now its broken is there anyway of adding new song using anpther laptop/desktop computer without erasing everything currently on my phone? I have no access to my old computer and the songs on it are from cds not itunes purchases
    Please help!!

    1) ensure iTunes is authorized for your iTunes store account(s)
    2) connect your device and right-click or control-click it in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.
    3) sync the device
    iTunes will wipe the iPhone but, since you transferred your purchases in the previous step, your content will be in your library and you can re-populate the iPhone with it.
    above works for purchases from the iTunes store. for everything else, check out this post by Zevoneer.

  • I have updated my iOS to 4.3.5.... And after that my 3gs iPhone still behaving like previous. Versions of iOS....... My iPhone. Showing no new feature which apple has added to iOS 5 like icloud , imessage... Should I update it again...?

    I have updated my iOS to 4.3.5.... And after that my 3gs iPhone still behaving like previous. Versions of iOS....... My iPhone. Showing no new feature which apple has added to iOS 5 like icloud , imessage... Should I update it again...?

    anshulmajoka wrote:
    I have updated my iOS to 4.3.5.... And after that my 3gs iPhone still behaving like previous. Versions of iOS....... My iPhone. Showing no new feature which apple has added to iOS 5 like icloud , imessage... Should I update it again...?
    iOS 4.3.5 is not the same as iOS 5. iOS 5 with the new features you list has not been released.
    Stedman

  • What is the default group id/ home /shell while adding new account with useradd without specifying these parameters?

    What is the default group id/ home /shell while adding new account with useradd without specifying these parameters?
    reagrds

    Hi,
    You can check the default values from the below file
    /usr/sadm/defadduser
    and from this command
    #useradd -D

  • Lumia 520 : No new features added after amber upda...

    I updated my Lumia 520 through OTA. After the process I could not find any new features and the about section does not show "Amber".
    What should I do?

    The 'Amber' version is found in Settings > extras+info and make sure you get the additional apps required which you can all find HERE
    Click on the blue Star Icon below if my advice has helped you or press the 'Accept As Solution' link if I solved your problem..

Maybe you are looking for