facebook

Another mode of operation for M4M?

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #286943 Reply

    Hello.

    Would it prove too difficult to add an alternate style of code generation besides the current extension model to M4M? The current model is based on extension, which isn’t IMO really extension, but composition, as shown below.

    
    public class MyComponent extends JPanel
    {
      private JComponent jComponent1;
      private JComponent jComponent2;
      public MyComponent() { initComponents(); }
      private void initComponents()
      {
        // Initialize the layout/components and add to this
      }
    }
    

    An alternative to this could be the ‘builder’ or ‘wrapper’ (or whatever =) pattern as shown below.

    
    public class MyComponent
    {
      private JPanel jPanel;
      private JComponent jComponent1;
      private JComponent jComponent2;
    
      public MyComponent() { initComponents(); }
    
      private void initComponents()
      {
        // Initialize the panel and other components, add layout and components to panel
      }
    
      public JPanel getInstance() { return jPanel; }
    
      // ...
    }
    

    This would have the added benefit of not only omitting the inheritance misuse, but also add the possibility for the wrapper class to extend another class if need be as well as providing an extra level of abstraction on top of the actual component. This would allow for example us to place internationalization/reinitialization code outside of the component.

    It is easy enough to transform currently generated code to this, but then consequent changes to the design invalidate it.

    Just a thought.

    #286962 Reply

    Loyal Water
    Member

    I’ll make a note of this feature request and move this to the feature request forum. Thank you for your feedback.

    #286999 Reply

    Thanks for your reply Nipun.

    Now what is your gut feeling, any chance this sort of feature would get incorporated into a future release in a reasonable time-frame?

    BR,
    Jukka

    #287017 Reply

    Loyal Water
    Member

    Jukka,
    Since we have this thread open on the feature request forum, the other users can vote in favor of this request. I feel the management will monitor the request, and incase the demand for this request shoots up, they might consider it a little sooner than otherwise.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Another mode of operation for M4M?

You must be logged in to post in the forum log in