<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://java.dzone.com"  xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dz="http://www.developerzone.com/modules/dz/1.0">
<channel>
 <title>Javalobby - Comments for &quot;Experimenting with First Class Methods (FCM)&quot;</title>
 <link>http://java.dzone.com/news/experimenting-fcm</link>
 <description>Comments for &quot;Experimenting with First Class Methods (FCM)&quot;</description>
 <language>en</language>
<item>
 <title>Thank you, I&#039;ll go check it</title>
 <link>http://java.dzone.com/news/experimenting-fcm#comment-2499</link>
 <description>&lt;!--paging_filter--&gt;Thank you, I&#039;ll go check it out.  I am really getting to like FCM.</description>
 <pubDate>Tue, 08 Apr 2008 08:34:11 -0400</pubDate>
 <dc:creator>cfagan</dc:creator>
 <guid isPermaLink="false">comment 2499 at http://java.dzone.com</guid>
</item>
<item>
 <title>Collin, for this</title>
 <link>http://java.dzone.com/news/experimenting-fcm#comment-1782</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;Collin, for this application, a better approach would be to use Instance Method References. These are implemented in svn, rather than the latest downloadable zip.&lt;/p&gt;&lt;pre&gt;public interface DataExtractor {&lt;/pre&gt;&lt;pre&gt;  Object extractData(Object targetToExtractFrom); &lt;/pre&gt;&lt;pre&gt;} &lt;/pre&gt;&lt;p&gt;You can then replace Method with DataExtractor. Now, only the correct methods can be passed in (like SuperHero#getFirstName()) and there is no need for the try/catch in the FCMMethodListModel (because no reflection is being used). &lt;/p&gt;</description>
 <pubDate>Tue, 11 Mar 2008 18:52:12 -0400</pubDate>
 <dc:creator>jodastephen</dc:creator>
 <guid isPermaLink="false">comment 1782 at http://java.dzone.com</guid>
</item>
<item>
 <title>I know you didn&#039;t pick the</title>
 <link>http://java.dzone.com/news/experimenting-fcm#comment-1780</link>
 <description>&lt;!--paging_filter--&gt;&lt;blockquote&gt;&lt;p&gt;I know you didn&#039;t pick the name of the proposal so this isn&#039;t directed
at you. But this is NOT closures. It&#039;s really just passing Method
objects around, which is something we can already do today.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;See the Inner Methods part of the FCM proposal for the closure-like part. Method literals (described here) and Method references (also in FCM) are obvious counterparts to closures, and often more useful. &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;One of the biggest problems I have with reflection is that Method
objects forget which instance they came from. So lots of times you have
to rejoin the Method object with a specific instance you want to invoke
that on.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt; See bound method references.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;I don&#039;t see why we couldn&#039;t just use the dot just like we do with functions today.  Something like:&lt;/p&gt;&lt;p&gt;Method methood = MyObject.method&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Because variables and methods are in different namespaces. You can have a variable and a method with the same name. Thus the code above cannot identify which you are referring to. &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt; Also I&#039;d like to see an Object.invoke() method to make using reflection easier.  For example:&lt;/p&gt;&lt;p&gt; Object result = someObject.invoke(&amp;quot;someMethod&amp;quot;, param1, param2 );&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt; Adding methods to Object can affect any current Java program. It is considered to be backwards incompatible as I understand it, and will never happen.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
 <pubDate>Tue, 11 Mar 2008 18:42:32 -0400</pubDate>
 <dc:creator>jodastephen</dc:creator>
 <guid isPermaLink="false">comment 1780 at http://java.dzone.com</guid>
</item>
<item>
 <title>Hi Charlie,I was exploring</title>
 <link>http://java.dzone.com/news/experimenting-fcm#comment-1760</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;Hi Charlie,&lt;/p&gt;&lt;p&gt;I was exploring just one of the aspects of FCM. I was interested in some of the functionality FCM has that other closure proposals do not. Some of the things you are looking for are possible in FCM.  I suggest you look into the bound method references.  They &amp;quot;remember&amp;quot; which object they came from. &lt;/p&gt;</description>
 <pubDate>Mon, 10 Mar 2008 15:35:36 -0400</pubDate>
 <dc:creator>cfagan</dc:creator>
 <guid isPermaLink="false">comment 1760 at http://java.dzone.com</guid>
</item>
<item>
 <title> Thank you Collin for</title>
 <link>http://java.dzone.com/news/experimenting-fcm#comment-1759</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thank you Collin for putting together this review.  I know you didn&#039;t pick the name of the proposal so this isn&#039;t directed at you.  But this is NOT closures.  It&#039;s really just passing Method objects around, which is something we can already do today.  Don&#039;t get my wrong I&#039;m not against something like this.  However, passing references to functions IS NOT closures.  It&#039;s just adding syntax directly to the Java language which would hopefully make using reflection easier.  I mainly say this such that people who don&#039;t really understand what a closures are don&#039;t confuse this proposal for real closures.  Or worse accept this proposal thinking they are getting the full power of closures when they&#039;re just getting sold a cheap knock-off.  This is just passing methods as arguments. &lt;/p&gt;&lt;p&gt;I do believe reflection is one of the most under-rated features of the Java language.  Without it there would be no way the framework explosion could have happened.  Java owes a lot of it&#039;s popularity to reflection, and anything we can do to improve it will have huge wins across the platform.   One of the reasons more people don&#039;t write code this way is because it&#039;s cumbersome to use.  While this is interesting.  It&#039;s not yet there so I hope they could improve the syntax both for invoking reflection and getting references to reflective objects (i.e. methods, and fields).&lt;/p&gt;&lt;p&gt;I don&#039;t see why we couldn&#039;t just use the dot just like we do with functions today.  Something like:&lt;/p&gt;&lt;p&gt;Method methood = MyObject.method&lt;/p&gt;&lt;p&gt;That way a method and a field reference don&#039;t differ at all in synaxt used.  Differentiating methods by parameter types would need some new type of syntax.  Possibly looking like generics with:&lt;/p&gt;&lt;p&gt;Method method = MyObject.someMethod&amp;lt;String,int&amp;gt;&lt;/p&gt;&lt;p&gt;Things to consider that could make this stuff more helpful:&lt;/p&gt;&lt;p&gt; 1.  Using Class to get references vs. an instance to get references to Method objects:  One of the biggest problems I have with reflection is that Method objects forget which instance they came from.  So lots of times you have to rejoin the Method object with a specific instance you want to invoke that on.  What if the method returned from an instance would remember the object it was gotten from.  (This would be a specific use of closures in a way, but not in a general sense).  Retrieving methods from a class would return just a Method object not associated with an instance like it does today.  Consider:&lt;/p&gt;&lt;p&gt;InstanceMethod method = someInstanceObject.method&lt;/p&gt;&lt;p&gt;Object result = method.invoke();&lt;/p&gt;&lt;p&gt; Notice that I didn&#039;t have to pass someInstanceObject back to the method&#039;s invoke method.  It remembered that I got the method from the instance someInstanceObject.  Constrast that with a class and you&#039;ll see the difference:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Method method = MyObject.method;&lt;/p&gt;&lt;p&gt;Object result = method.invoke( someInstanceObject ); &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;These two examples are equivalent, but you see how the caller doesn&#039;t have to keep track of the instance it came from.  This makes it easier to hide contextual data inside an object without have to pass that contextual data through the caller of the method reference.  This makes it easier to integrate two objects without having to know details what data method needs.  Consider if a comparator is being used to sort a list of items where the comparator has some instance data it needs that isn&#039;t apart of the objects it&#039;s sorting.  Passing just method objects around can&#039;t account for that use case. &lt;/p&gt;&lt;p&gt; Also I&#039;d like to see an Object.invoke() method to make using reflection easier.  For example:&lt;/p&gt;&lt;p&gt; Object result = someObject.invoke(&amp;quot;someMethod&amp;quot;, param1, param2 );&lt;/p&gt;&lt;p&gt; One liner method innovcation for reflection.  That&#039;s a really simple reflection helper, and every object would get it! &lt;/p&gt;</description>
 <pubDate>Mon, 10 Mar 2008 14:47:08 -0400</pubDate>
 <dc:creator>ch73896</dc:creator>
 <guid isPermaLink="false">comment 1759 at http://java.dzone.com</guid>
</item>
<item>
 <title>I&#039;m sorry I am having</title>
 <link>http://java.dzone.com/news/experimenting-fcm#comment-1750</link>
 <description>&lt;!--paging_filter--&gt;I&#039;m sorry I am having trouble seeing the relevance of your statements. I used references to getters and setters because that what most people see in the wild. You can have a reference to any method, regardless of it&#039;s name and the above code would work fine. I think this actually makes things less complex because you would have to write table/list/tree models less often. Do you have an issue with type-safe method references?</description>
 <pubDate>Mon, 10 Mar 2008 11:23:47 -0400</pubDate>
 <dc:creator>cfagan</dc:creator>
 <guid isPermaLink="false">comment 1750 at http://java.dzone.com</guid>
</item>
<item>
 <title>The problem with tools which</title>
 <link>http://java.dzone.com/news/experimenting-fcm#comment-1729</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;The problem with tools which automate CRUD creation is that they produce really bad APIs. We&#039;ve spent so much time trying to come up with better CRUD automation tools that we haven&#039;t stopped to consider whether we&#039;re going in the right direction to begin with.&lt;/p&gt;&lt;p&gt;JavaBeans and XML enable computers to parse data programmatically but they amount to really awful API design and configuration file formats. In short, they&#039;re made for computers, not humans. Fix that problem first and all the rest will follow.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Resources:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://martinfowler.com/bliki/GetterEradicator.html&quot;&gt;http://martinfowler.com/bliki/GetterEradicator.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.javadonkey.com/blog/are-getters-and-setters-evil/&quot;&gt;http://www.javadonkey.com/blog/are-getters-and-setters-evil/&lt;/a&gt; &lt;/p&gt;</description>
 <pubDate>Sun, 09 Mar 2008 01:28:44 -0500</pubDate>
 <dc:creator>cowwoc</dc:creator>
 <guid isPermaLink="false">comment 1729 at http://java.dzone.com</guid>
</item>
</channel>
</rss>
