Bug 473619 - Partial Classes
Summary: Partial Classes
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Backlog (show other bugs)
Version: 2.8.4   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL: https://groups.google.com/forum/#!top...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-27 05:19 EDT by Kirsten M. Z. CLA
Modified: 2015-07-27 08:16 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirsten M. Z. CLA 2015-07-27 05:19:37 EDT
Simply think about the feature in C#. Unfortunately, it is not supported by Java. However, with Xtend it would be possible.

For a list of benefits, see also: https://en.wikipedia.org/wiki/Class_(computer_programming)#Partial


sampleFile1.xtend (Example 1):

  partial class MyClass {
    def void func1TypeA() {}
    def void func2TypeA() {}
    def void func3TypeA() {}
  }


sampleFile2.xtend (Example 1):

  partial class MyClass {
    def void func1TypeB() {}
    def void func2TypeB() {}
    def void func3TypeB() {}
  }


MyClass.java (Example 1):

  public class MyClass {
    public void func1TypeA() {}
    public void func2TypeA() {}
    public void func3TypeA() {}
    public void func1TypeB() {}
    public void func2TypeB() {}
    public void func3TypeB() {}
  }