Configuring an editor for various languages using Factory Method Pattern Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Factory to instantiate and configure Selenium WebDriverIs this correct factory method pattern?Java implementation of the Factory Method patternSwing MVC and Command PatternPHP Factory Method Pattern ImplementationBusiness interfaces and packagesImplementation of Factory Method pattern for XML and Excel documentsSimple factory pattern for cooking a pizzaFactory Method Pattern - Base implementation to Add New RecordsFactory design pattern for circles and polygonsFactory design pattern with Shapes

Can gravitational waves pass through a black hole?

Is a copyright notice with a non-existent name be invalid?

Weaponising the Grasp-at-a-Distance spell

calculator's angle answer for trig ratios that can work in more than 1 quadrant on the unit circle

3D Masyu - A Die

Flight departed from the gate 5 min before scheduled departure time. Refund options

Should man-made satellites feature an intelligent inverted "cow catcher"?

Where did Ptolemy compare the Earth to the distance of fixed stars?

Bash script to execute command with file from directory and condition

A German immigrant ancestor has a "Registration Affidavit of Alien Enemy" on file. What does that mean exactly?

Why are current probes so expensive?

Is there a canonical “inverse” of Abelianization?

How can I list files in reverse time order by a command and pass them as arguments to another command?

malloc in main() or malloc in another function: allocating memory for a struct and its members

How to achieve cat-like agility?

Can I take recommendation from someone I met at a conference?

New Order #6: Easter Egg

draw a pulley system

Improvising over quartal voicings

Table formatting with tabularx?

Sankhya yoga - Bhagvat Gita

How to show a density matrix is in a pure/mixed state?

Understanding piped commands in GNU/Linux

Why is there so little support for joining EFTA in the British parliament?



Configuring an editor for various languages using Factory Method Pattern



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Factory to instantiate and configure Selenium WebDriverIs this correct factory method pattern?Java implementation of the Factory Method patternSwing MVC and Command PatternPHP Factory Method Pattern ImplementationBusiness interfaces and packagesImplementation of Factory Method pattern for XML and Excel documentsSimple factory pattern for cooking a pizzaFactory Method Pattern - Base implementation to Add New RecordsFactory design pattern for circles and polygonsFactory design pattern with Shapes



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4












$begingroup$


I need to know if my code is a valid implementation of the factory method pattern. Also, if the Configuration and Editor were interfaces would this still be a valid implementation of the Factory Pattern?



public abstract class Configuration 

protected List<String> keyWords;

abstract void getTheme();
abstract String getKeyWords();





public abstract class Editor 

public final void useEditor()
Configuration configuration = createConfiguration();
configuration.getTheme();
parse(configuration.getKeyWords());
save();


//The Factory Method
public abstract Configuration createConfiguration();

public abstract void parse(String sourceCode);

public void save()
System.out.println("The file was saved..");






public class JavaConfiguration extends Configuration 
public JavaConfiguration()
keyWords = new ArrayList<>();
keyWords.add("class");
keyWords.add("protected");


@Override
void getTheme()
System.out.println("Applied Java Theme...");


@Override
String getKeyWords()
return keyWords.toString();






public class PythonConfiguration extends Configuration 

public PythonConfiguration()
keyWords = new ArrayList<>();
keyWords.add("def");
keyWords.add("print");


@Override
void getTheme()
System.out.println("Applied Python Theme...");


@Override
String getKeyWords()
return keyWords.toString();






public class JavaEditor extends Editor 
@Override
public Configuration createConfiguration()
return new JavaConfiguration();


@Override
public void parse(String sourceCode)
System.out.println("Parsing Java code...");






public class PythonEditor extends Editor 

@Override
public Configuration createConfiguration()
return new PythonConfiguration();


@Override
public void parse(String sourceCode)
System.out.println("Parsing python code...");






public class App 

public static void main(String[] args)
Scanner sc = new Scanner(System.in);
String language = sc.next();
Editor editor = createEditor(language);
editor.useEditor();


private static Editor createEditor(String language)
switch(language)
case "Java":
return new JavaEditor();
case "Python":
return new PythonEditor();
default:
return null;





Edit: It seems that the Factory Method Pattern is not the appropriate design pattern to use in this case, as suggested by @200_success and @Timothy Truckle. A simple Editor class which receives a Configuration as a parameter should be enough.










share|improve this question











$endgroup$


















    4












    $begingroup$


    I need to know if my code is a valid implementation of the factory method pattern. Also, if the Configuration and Editor were interfaces would this still be a valid implementation of the Factory Pattern?



    public abstract class Configuration 

    protected List<String> keyWords;

    abstract void getTheme();
    abstract String getKeyWords();





    public abstract class Editor 

    public final void useEditor()
    Configuration configuration = createConfiguration();
    configuration.getTheme();
    parse(configuration.getKeyWords());
    save();


    //The Factory Method
    public abstract Configuration createConfiguration();

    public abstract void parse(String sourceCode);

    public void save()
    System.out.println("The file was saved..");






    public class JavaConfiguration extends Configuration 
    public JavaConfiguration()
    keyWords = new ArrayList<>();
    keyWords.add("class");
    keyWords.add("protected");


    @Override
    void getTheme()
    System.out.println("Applied Java Theme...");


    @Override
    String getKeyWords()
    return keyWords.toString();






    public class PythonConfiguration extends Configuration 

    public PythonConfiguration()
    keyWords = new ArrayList<>();
    keyWords.add("def");
    keyWords.add("print");


    @Override
    void getTheme()
    System.out.println("Applied Python Theme...");


    @Override
    String getKeyWords()
    return keyWords.toString();






    public class JavaEditor extends Editor 
    @Override
    public Configuration createConfiguration()
    return new JavaConfiguration();


    @Override
    public void parse(String sourceCode)
    System.out.println("Parsing Java code...");






    public class PythonEditor extends Editor 

    @Override
    public Configuration createConfiguration()
    return new PythonConfiguration();


    @Override
    public void parse(String sourceCode)
    System.out.println("Parsing python code...");






    public class App 

    public static void main(String[] args)
    Scanner sc = new Scanner(System.in);
    String language = sc.next();
    Editor editor = createEditor(language);
    editor.useEditor();


    private static Editor createEditor(String language)
    switch(language)
    case "Java":
    return new JavaEditor();
    case "Python":
    return new PythonEditor();
    default:
    return null;





    Edit: It seems that the Factory Method Pattern is not the appropriate design pattern to use in this case, as suggested by @200_success and @Timothy Truckle. A simple Editor class which receives a Configuration as a parameter should be enough.










    share|improve this question











    $endgroup$














      4












      4








      4





      $begingroup$


      I need to know if my code is a valid implementation of the factory method pattern. Also, if the Configuration and Editor were interfaces would this still be a valid implementation of the Factory Pattern?



      public abstract class Configuration 

      protected List<String> keyWords;

      abstract void getTheme();
      abstract String getKeyWords();





      public abstract class Editor 

      public final void useEditor()
      Configuration configuration = createConfiguration();
      configuration.getTheme();
      parse(configuration.getKeyWords());
      save();


      //The Factory Method
      public abstract Configuration createConfiguration();

      public abstract void parse(String sourceCode);

      public void save()
      System.out.println("The file was saved..");






      public class JavaConfiguration extends Configuration 
      public JavaConfiguration()
      keyWords = new ArrayList<>();
      keyWords.add("class");
      keyWords.add("protected");


      @Override
      void getTheme()
      System.out.println("Applied Java Theme...");


      @Override
      String getKeyWords()
      return keyWords.toString();






      public class PythonConfiguration extends Configuration 

      public PythonConfiguration()
      keyWords = new ArrayList<>();
      keyWords.add("def");
      keyWords.add("print");


      @Override
      void getTheme()
      System.out.println("Applied Python Theme...");


      @Override
      String getKeyWords()
      return keyWords.toString();






      public class JavaEditor extends Editor 
      @Override
      public Configuration createConfiguration()
      return new JavaConfiguration();


      @Override
      public void parse(String sourceCode)
      System.out.println("Parsing Java code...");






      public class PythonEditor extends Editor 

      @Override
      public Configuration createConfiguration()
      return new PythonConfiguration();


      @Override
      public void parse(String sourceCode)
      System.out.println("Parsing python code...");






      public class App 

      public static void main(String[] args)
      Scanner sc = new Scanner(System.in);
      String language = sc.next();
      Editor editor = createEditor(language);
      editor.useEditor();


      private static Editor createEditor(String language)
      switch(language)
      case "Java":
      return new JavaEditor();
      case "Python":
      return new PythonEditor();
      default:
      return null;





      Edit: It seems that the Factory Method Pattern is not the appropriate design pattern to use in this case, as suggested by @200_success and @Timothy Truckle. A simple Editor class which receives a Configuration as a parameter should be enough.










      share|improve this question











      $endgroup$




      I need to know if my code is a valid implementation of the factory method pattern. Also, if the Configuration and Editor were interfaces would this still be a valid implementation of the Factory Pattern?



      public abstract class Configuration 

      protected List<String> keyWords;

      abstract void getTheme();
      abstract String getKeyWords();





      public abstract class Editor 

      public final void useEditor()
      Configuration configuration = createConfiguration();
      configuration.getTheme();
      parse(configuration.getKeyWords());
      save();


      //The Factory Method
      public abstract Configuration createConfiguration();

      public abstract void parse(String sourceCode);

      public void save()
      System.out.println("The file was saved..");






      public class JavaConfiguration extends Configuration 
      public JavaConfiguration()
      keyWords = new ArrayList<>();
      keyWords.add("class");
      keyWords.add("protected");


      @Override
      void getTheme()
      System.out.println("Applied Java Theme...");


      @Override
      String getKeyWords()
      return keyWords.toString();






      public class PythonConfiguration extends Configuration 

      public PythonConfiguration()
      keyWords = new ArrayList<>();
      keyWords.add("def");
      keyWords.add("print");


      @Override
      void getTheme()
      System.out.println("Applied Python Theme...");


      @Override
      String getKeyWords()
      return keyWords.toString();






      public class JavaEditor extends Editor 
      @Override
      public Configuration createConfiguration()
      return new JavaConfiguration();


      @Override
      public void parse(String sourceCode)
      System.out.println("Parsing Java code...");






      public class PythonEditor extends Editor 

      @Override
      public Configuration createConfiguration()
      return new PythonConfiguration();


      @Override
      public void parse(String sourceCode)
      System.out.println("Parsing python code...");






      public class App 

      public static void main(String[] args)
      Scanner sc = new Scanner(System.in);
      String language = sc.next();
      Editor editor = createEditor(language);
      editor.useEditor();


      private static Editor createEditor(String language)
      switch(language)
      case "Java":
      return new JavaEditor();
      case "Python":
      return new PythonEditor();
      default:
      return null;





      Edit: It seems that the Factory Method Pattern is not the appropriate design pattern to use in this case, as suggested by @200_success and @Timothy Truckle. A simple Editor class which receives a Configuration as a parameter should be enough.







      java object-oriented factory-method






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 25 mins ago







      ovidiu-miu

















      asked Mar 15 '17 at 22:22









      ovidiu-miuovidiu-miu

      624




      624




















          2 Answers
          2






          active

          oldest

          votes


















          3












          $begingroup$


          I need to know if my code is a valid implementation of the factory method pattern.




          No.



          The reason is that the factory cannot be part of the objects to be created. I think you would be surprised to find a factory in the the hedge of your car, wouldn't you?



          Generally spoken your approach fails the Separation of Concerns principle.



          You have two responsibilities in your code that belong to a factory:



          1. identifying the requested type.

          2. creating the actual object.

          Both should be in a separate factory class.




          Also: your "factory" is producing the wrong type of objects because of your misconception of inheritance.



          We employ inheritance when the child classes differ in behavior. But your Editor extensions only differ in configuration (as far as your code example is showing...).



          So what your (yet to build) factory should do is creating the "language depended" key word list and pass that into a new instance of the one and only Editor class.






          share|improve this answer









          $endgroup$




















            2












            $begingroup$

            The getKeyWords() method is not particularly useful. It takes a List<String> and summarizes its contents in a degraded form. It's particularly inappropriate for Editor.useEditor() to attempt to parse this undocumented string representation. I would prefer to have it return an unmodifiable list. The JavaConfiguration class would be better written as



            import java.util.Arrays;
            import java.util.Collections;

            public class JavaConfiguration extends Configuration
            private static List<> KEYWORDS = Collections.unmodifiableList(Arrays.asList(
            "class",
            "protected"
            ));

            @Override
            List<String> getKeywords()
            return KEYWORDS;






            Does the order of the keywords matter? Perhaps a Set would be more appropriate than a List.




            Typically, you wouldn't want to have the App be responsible for performing the translation from language name to the associated Configuration object.



            public abstract class Configuration 
            abstract void getTheme();
            abstract List<String> getKeywords();

            public static Configuration forLanguage(String language)
            switch (language)
            case "Java":






            A factory might not be the most appropriate pattern, though, since there isn't any point in instantiating many copies of each Configuration subclass. Reusing singletons might be better.




            One would hope that the whole point of having various Configurations is to contain all the language-specific behaviours of the Editor. Therefore, if the system is designed properly, then there should only be one Editor class, whose constructor accepts a Configuration. (I'm assuming that you don't need the Editor to be able to switch languages on the fly.)






            share|improve this answer









            $endgroup$













              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "196"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f157875%2fconfiguring-an-editor-for-various-languages-using-factory-method-pattern%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3












              $begingroup$


              I need to know if my code is a valid implementation of the factory method pattern.




              No.



              The reason is that the factory cannot be part of the objects to be created. I think you would be surprised to find a factory in the the hedge of your car, wouldn't you?



              Generally spoken your approach fails the Separation of Concerns principle.



              You have two responsibilities in your code that belong to a factory:



              1. identifying the requested type.

              2. creating the actual object.

              Both should be in a separate factory class.




              Also: your "factory" is producing the wrong type of objects because of your misconception of inheritance.



              We employ inheritance when the child classes differ in behavior. But your Editor extensions only differ in configuration (as far as your code example is showing...).



              So what your (yet to build) factory should do is creating the "language depended" key word list and pass that into a new instance of the one and only Editor class.






              share|improve this answer









              $endgroup$

















                3












                $begingroup$


                I need to know if my code is a valid implementation of the factory method pattern.




                No.



                The reason is that the factory cannot be part of the objects to be created. I think you would be surprised to find a factory in the the hedge of your car, wouldn't you?



                Generally spoken your approach fails the Separation of Concerns principle.



                You have two responsibilities in your code that belong to a factory:



                1. identifying the requested type.

                2. creating the actual object.

                Both should be in a separate factory class.




                Also: your "factory" is producing the wrong type of objects because of your misconception of inheritance.



                We employ inheritance when the child classes differ in behavior. But your Editor extensions only differ in configuration (as far as your code example is showing...).



                So what your (yet to build) factory should do is creating the "language depended" key word list and pass that into a new instance of the one and only Editor class.






                share|improve this answer









                $endgroup$















                  3












                  3








                  3





                  $begingroup$


                  I need to know if my code is a valid implementation of the factory method pattern.




                  No.



                  The reason is that the factory cannot be part of the objects to be created. I think you would be surprised to find a factory in the the hedge of your car, wouldn't you?



                  Generally spoken your approach fails the Separation of Concerns principle.



                  You have two responsibilities in your code that belong to a factory:



                  1. identifying the requested type.

                  2. creating the actual object.

                  Both should be in a separate factory class.




                  Also: your "factory" is producing the wrong type of objects because of your misconception of inheritance.



                  We employ inheritance when the child classes differ in behavior. But your Editor extensions only differ in configuration (as far as your code example is showing...).



                  So what your (yet to build) factory should do is creating the "language depended" key word list and pass that into a new instance of the one and only Editor class.






                  share|improve this answer









                  $endgroup$




                  I need to know if my code is a valid implementation of the factory method pattern.




                  No.



                  The reason is that the factory cannot be part of the objects to be created. I think you would be surprised to find a factory in the the hedge of your car, wouldn't you?



                  Generally spoken your approach fails the Separation of Concerns principle.



                  You have two responsibilities in your code that belong to a factory:



                  1. identifying the requested type.

                  2. creating the actual object.

                  Both should be in a separate factory class.




                  Also: your "factory" is producing the wrong type of objects because of your misconception of inheritance.



                  We employ inheritance when the child classes differ in behavior. But your Editor extensions only differ in configuration (as far as your code example is showing...).



                  So what your (yet to build) factory should do is creating the "language depended" key word list and pass that into a new instance of the one and only Editor class.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 16 '17 at 10:10









                  Timothy TruckleTimothy Truckle

                  4,981416




                  4,981416























                      2












                      $begingroup$

                      The getKeyWords() method is not particularly useful. It takes a List<String> and summarizes its contents in a degraded form. It's particularly inappropriate for Editor.useEditor() to attempt to parse this undocumented string representation. I would prefer to have it return an unmodifiable list. The JavaConfiguration class would be better written as



                      import java.util.Arrays;
                      import java.util.Collections;

                      public class JavaConfiguration extends Configuration
                      private static List<> KEYWORDS = Collections.unmodifiableList(Arrays.asList(
                      "class",
                      "protected"
                      ));

                      @Override
                      List<String> getKeywords()
                      return KEYWORDS;






                      Does the order of the keywords matter? Perhaps a Set would be more appropriate than a List.




                      Typically, you wouldn't want to have the App be responsible for performing the translation from language name to the associated Configuration object.



                      public abstract class Configuration 
                      abstract void getTheme();
                      abstract List<String> getKeywords();

                      public static Configuration forLanguage(String language)
                      switch (language)
                      case "Java":






                      A factory might not be the most appropriate pattern, though, since there isn't any point in instantiating many copies of each Configuration subclass. Reusing singletons might be better.




                      One would hope that the whole point of having various Configurations is to contain all the language-specific behaviours of the Editor. Therefore, if the system is designed properly, then there should only be one Editor class, whose constructor accepts a Configuration. (I'm assuming that you don't need the Editor to be able to switch languages on the fly.)






                      share|improve this answer









                      $endgroup$

















                        2












                        $begingroup$

                        The getKeyWords() method is not particularly useful. It takes a List<String> and summarizes its contents in a degraded form. It's particularly inappropriate for Editor.useEditor() to attempt to parse this undocumented string representation. I would prefer to have it return an unmodifiable list. The JavaConfiguration class would be better written as



                        import java.util.Arrays;
                        import java.util.Collections;

                        public class JavaConfiguration extends Configuration
                        private static List<> KEYWORDS = Collections.unmodifiableList(Arrays.asList(
                        "class",
                        "protected"
                        ));

                        @Override
                        List<String> getKeywords()
                        return KEYWORDS;






                        Does the order of the keywords matter? Perhaps a Set would be more appropriate than a List.




                        Typically, you wouldn't want to have the App be responsible for performing the translation from language name to the associated Configuration object.



                        public abstract class Configuration 
                        abstract void getTheme();
                        abstract List<String> getKeywords();

                        public static Configuration forLanguage(String language)
                        switch (language)
                        case "Java":






                        A factory might not be the most appropriate pattern, though, since there isn't any point in instantiating many copies of each Configuration subclass. Reusing singletons might be better.




                        One would hope that the whole point of having various Configurations is to contain all the language-specific behaviours of the Editor. Therefore, if the system is designed properly, then there should only be one Editor class, whose constructor accepts a Configuration. (I'm assuming that you don't need the Editor to be able to switch languages on the fly.)






                        share|improve this answer









                        $endgroup$















                          2












                          2








                          2





                          $begingroup$

                          The getKeyWords() method is not particularly useful. It takes a List<String> and summarizes its contents in a degraded form. It's particularly inappropriate for Editor.useEditor() to attempt to parse this undocumented string representation. I would prefer to have it return an unmodifiable list. The JavaConfiguration class would be better written as



                          import java.util.Arrays;
                          import java.util.Collections;

                          public class JavaConfiguration extends Configuration
                          private static List<> KEYWORDS = Collections.unmodifiableList(Arrays.asList(
                          "class",
                          "protected"
                          ));

                          @Override
                          List<String> getKeywords()
                          return KEYWORDS;






                          Does the order of the keywords matter? Perhaps a Set would be more appropriate than a List.




                          Typically, you wouldn't want to have the App be responsible for performing the translation from language name to the associated Configuration object.



                          public abstract class Configuration 
                          abstract void getTheme();
                          abstract List<String> getKeywords();

                          public static Configuration forLanguage(String language)
                          switch (language)
                          case "Java":






                          A factory might not be the most appropriate pattern, though, since there isn't any point in instantiating many copies of each Configuration subclass. Reusing singletons might be better.




                          One would hope that the whole point of having various Configurations is to contain all the language-specific behaviours of the Editor. Therefore, if the system is designed properly, then there should only be one Editor class, whose constructor accepts a Configuration. (I'm assuming that you don't need the Editor to be able to switch languages on the fly.)






                          share|improve this answer









                          $endgroup$



                          The getKeyWords() method is not particularly useful. It takes a List<String> and summarizes its contents in a degraded form. It's particularly inappropriate for Editor.useEditor() to attempt to parse this undocumented string representation. I would prefer to have it return an unmodifiable list. The JavaConfiguration class would be better written as



                          import java.util.Arrays;
                          import java.util.Collections;

                          public class JavaConfiguration extends Configuration
                          private static List<> KEYWORDS = Collections.unmodifiableList(Arrays.asList(
                          "class",
                          "protected"
                          ));

                          @Override
                          List<String> getKeywords()
                          return KEYWORDS;






                          Does the order of the keywords matter? Perhaps a Set would be more appropriate than a List.




                          Typically, you wouldn't want to have the App be responsible for performing the translation from language name to the associated Configuration object.



                          public abstract class Configuration 
                          abstract void getTheme();
                          abstract List<String> getKeywords();

                          public static Configuration forLanguage(String language)
                          switch (language)
                          case "Java":






                          A factory might not be the most appropriate pattern, though, since there isn't any point in instantiating many copies of each Configuration subclass. Reusing singletons might be better.




                          One would hope that the whole point of having various Configurations is to contain all the language-specific behaviours of the Editor. Therefore, if the system is designed properly, then there should only be one Editor class, whose constructor accepts a Configuration. (I'm assuming that you don't need the Editor to be able to switch languages on the fly.)







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 15 '17 at 23:00









                          200_success200_success

                          131k17157422




                          131k17157422



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Code Review Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              Use MathJax to format equations. MathJax reference.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f157875%2fconfiguring-an-editor-for-various-languages-using-factory-method-pattern%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              名間水力發電廠 目录 沿革 設施 鄰近設施 註釋 外部連結 导航菜单23°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.7113923°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.71139計畫概要原始内容臺灣第一座BOT 模式開發的水力發電廠-名間水力電廠名間水力發電廠 水利署首件BOT案原始内容《小檔案》名間電廠 首座BOT水力發電廠原始内容名間電廠BOT - 經濟部水利署中區水資源局

                              Prove that NP is closed under karp reduction?Space(n) not closed under Karp reductions - what about NTime(n)?Class P is closed under rotation?Prove or disprove that $NL$ is closed under polynomial many-one reductions$mathbfNC_2$ is closed under log-space reductionOn Karp reductionwhen can I know if a class (complexity) is closed under reduction (cook/karp)Check if class $PSPACE$ is closed under polyonomially space reductionIs NPSPACE also closed under polynomial-time reduction and under log-space reduction?Prove PSPACE is closed under complement?Prove PSPACE is closed under union?

                              Is my guitar’s action too high? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Strings too stiff on a recently purchased acoustic guitar | Cort AD880CEIs the action of my guitar really high?Μy little finger is too weak to play guitarWith guitar, how long should I give my fingers to strengthen / callous?When playing a fret the guitar sounds mutedPlaying (Barre) chords up the guitar neckI think my guitar strings are wound too tight and I can't play barre chordsF barre chord on an SG guitarHow to find to the right strings of a barre chord by feel?High action on higher fret on my steel acoustic guitar