Main page / Java Connectivity page

Attributes - Java attributes (set/get/is)


Description: 
	JavaBeans are using a design pattern for simple write-read attributes or
	simple read-only attributes. These attributes are mapped to .Net properties.
	
	This example uses a Java class that offers some attributes. The access to these 
	Java attributes is achieved by implementing standard .Net properties.

Source: 
	MinCor\DemoJava\Attributes

Mapping: 
	get/set/is  <--->  .Net Attributes



Example 

The Java server:

    Interface     : Attributes\Greetings.java
    Implementation: Attributes\GreetingsImpl.java
    
    
    public interface Greetings extends Remote  {
    
        void setFirstName( String name)
            throws RemoteException;
        
        String getFirstName()
            throws RemoteException;

        void setBar( boolean oBar)
            throws RemoteException;
		
        boolean isBar()
            throws RemoteException;

        boolean getBar()
            throws RemoteException;
    }	
    


The .Net client:

    Implementation: ClientImpl.cs
    IDL-File      : Arrays.idl
    Generated     : Attributes.cs
 
    Get access to the server object through .Net attributes:
      
    oGreetings.firstName = "Middsol";
    a_oFrmClt.writeLog("Get property FirstName: "+ oGreetings.firstName);
    
    oGreetings.bar = false;
    a_oFrmClt.writeLog("Get property Bar      : "+ oGreetings.bar);
    a_oFrmClt.writeLog("Call function getBar(): "+ oGreetings.getBar());
          
    
    Remarks:
    - setFirstName is mapped to the .Net firstname (set) attribute 
    - getFirstName is mapped to the .Net firstname (get) attribute

    - setBar is mapped to the .Net bar (set) attribute 
    - isBar  is mapped to the .Net bar (get) attribute
    - getBar is mapped to the .Net function getBar()