[Mono-list] Java and C#

Leandro André Zis lezis@st.com.br
Fri, 19 Mar 2004 17:36:17 -0300


This is a multi-part message in MIME format.
--------------000105020603090608040001
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

The attributes in java have some differences from .net:

- they are called annotations
- they can be RUNTIME or SOURCE_ONLY
- they are interfaces
- the SOURCE_ONLY  annotations can be applied to local variables

A Rafael D Teixeira wrote:

>On Thu, 2004-03-18 at 22:35, Jonathan Pryor wrote:
>  
>
>>I suspect that there is no way to add attributes in Java.  Microsoft's
>>Visual J# permits the use of Attributes (IIRC), but it's through their
>>Visual J++ syntax -- through a specially formed JavaDoc comment. 
>>Something like (from memory):
>>
>>	/**
>>	 * @attribute-name (args...)
>>	 */
>>	public void myMethod () {/* ... */}
>>
>>Of course, that's compiler specific, and no standard Java compiler will
>>support that.  So when it comes to attributes, you're probably up the
>>creek.
>>
>> - Jon
>>    
>>
>
>Maybe when ikvm supports Java 'Tiger' 1.5, that has attributes added to
>the language (well sort-of, because it resembles the Visual J# way...).
>
>My two cents,
>  
>

--------------000105020603090608040001
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
The attributes in java have some differences from .net:<br>
<br>
- they are called annotations <br>
- they can be RUNTIME or SOURCE_ONLY<br>
- they are interfaces <br>
- the SOURCE_ONLY&nbsp; annotations can be applied to local variables<br>
<br>
A Rafael D Teixeira wrote:<br>
<blockquote cite="mid1079705071.3741.13.camel@redhat9.tempolivre.com.br"
 type="cite">
  <pre wrap="">On Thu, 2004-03-18 at 22:35, Jonathan Pryor wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I suspect that there is no way to add attributes in Java.  Microsoft's
Visual J# permits the use of Attributes (IIRC), but it's through their
Visual J++ syntax -- through a specially formed JavaDoc comment. 
Something like (from memory):

	/**
	 * @attribute-name (args...)
	 */
	public void myMethod () {/* ... */}

Of course, that's compiler specific, and no standard Java compiler will
support that.  So when it comes to attributes, you're probably up the
creek.

 - Jon
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Maybe when ikvm supports Java 'Tiger' 1.5, that has attributes added to
the language (well sort-of, because it resembles the Visual J# way...).

My two cents,
  </pre>
</blockquote>
</body>
</html>

--------------000105020603090608040001--