Modifying Java, Explained!
I need to clarify an important aspect of Awesome Sauce Java with regards to method names and evolving Java. Awesome Sauce Java can offer (at least) three different types of method signatures with regards to the name of the method and the return type. There are many aspects of Java that can be modified, but the first that makes sense to present is with regards to method names and return types. Here are the three types of method signatures I'm going to offer in Awesome Sauce Java:
- Standard Java calls
- Nothing changed in any part of the method signature.
- Standard Java methods altered to become Functional Java calls
- Returning a value that makes sense in the context of functional programming.
- Upgraded/renamed Java calls that either preserve the Standard Java method signature, or offer a Functional method signature.
I'm going to present how a method can evolve to offer different signatures using an example from the javax.swing.JTable.TableColumnModel class, which I happen to have open in Javadoc right now. I'll show how one function can be associated with each category listed above:
- Standard Java call (unchanged)
- void removeColumnModelListener(TableColumnModelListener x)
- Functional Java call (returns a value that makes sense in the context of functional programming)
- TableColumnModelListener removeColumnModelListener( TableColumnModelListener x)
- Upgraded/renamed Java call (can offer either type of method described in #1 and #2 above)
- void remove(TableColumnModelListener x)
- new name, same return type as standard Java
- TableColumnModelListener remove(TableColumnModelListener x)
- new name, returning a value in support of functional programming.
Reworking Java For Sure, For Sure
I'm going to upgrade the names of the methods where it makes sense. Because in my 34 wildly all over the place years of writing code, I've noticed that when code is clean, terms are clear to divine, and there are few contextual hiccups or gotchas, it's easier to write code. Java is a nice language that's very mature and stable, but some of the names could be reduced to make the language a little easier to work with. I'll write more on this laterAs far as using new names, but needing to output Standard Java? The Awesome Editor can be used as a prototyping tool, to assist with rapidly prototyping a method or class. If a user needed to wanted to use the renamed Java method names in Awesome Sauce Java, they would still be able to generate Standard Java from their prototype code. The Awesome Editor will be able to convert any form of the calls above to pure, standard Java, for import into a standard Java application. Freedom is about choice and I'm working to put the choices in the right place.
The point of this presentation has been to show how Awesome Sauce Java provides options to evolve Java method signatures by offering a choice of (at least) three types of method calls:
- Standard Java methods, unchanged.
- Standard Java names converted to Functional signatures.
- Renamed method names that either preserve the Standard Java method signature or present a Functional method signature.
Have a great day!
Comments
Post a Comment