Click here to Skip to main content
15,886,518 members
Articles / Containers / Virtual Machine

.NET/Java Interoperability using Service Interface and DTO Architecture Patterns

Rate me:
Please Sign up or sign in to vote.
4.73/5 (8 votes)
7 Feb 2011CPOL5 min read 49.4K   234   15  
This article shows you how to build a simple cross-platform interoperation solution between .NET and Java using the Service Interface and Data Transfer Object (DTO) architecture patterns
//Auto generated code
//Code generated by XXsd2Code<http://xxsd2code.sourceforge.net/> XXsd2Code.exe version 1.0.0
//For any comments/suggestions contact code generator author at asheesh.goja@gmail.com
//Auto generated code
 
package CustomerOrderAndFulfillment.Contract;
 
 
public	class	CustomerOrder implements Cloneable
{
	public	String	OrderNumber;
	public	CreditRating	Rating;
	public	CustomerOrderAndFulfillment.CommonSchemaElements.Address	AddressInfo;

	public	java.util.List<CustomerOrderAndFulfillment.CommonSchemaElements.OrderItem>	Orders;
	public	CustomerOrderAndFulfillment.CommonSchemaElements.CreditCardDetails	CcInfo;
			
	//default constructor
	public	CustomerOrder()
	{
		OrderNumber = "";
		Rating = CustomerOrderAndFulfillment.Contract.CreditRating.Good ;
		AddressInfo = new CustomerOrderAndFulfillment.CommonSchemaElements.Address() ;
		Orders = new java.util.ArrayList<CustomerOrderAndFulfillment.CommonSchemaElements.OrderItem>() ;
		CcInfo = new CustomerOrderAndFulfillment.CommonSchemaElements.CreditCardDetails() ;
	}
			
	//Clonable Override
	@Override  public	CustomerOrder clone()	throws CloneNotSupportedException
	{
		CustomerOrder	 instance = new CustomerOrder() ;
		instance.OrderNumber = OrderNumber ;
		instance.Rating = Rating ;
		instance.AddressInfo = (CustomerOrderAndFulfillment.CommonSchemaElements.Address)AddressInfo.clone() ;
		instance.Orders.addAll(Orders) ;
		instance.CcInfo = (CustomerOrderAndFulfillment.CommonSchemaElements.CreditCardDetails)CcInfo.clone() ;
		return instance;
	}
			
	//DeepCopy
	public	void DeepCopy(CustomerOrder rhs)
	{
		OrderNumber = rhs.OrderNumber ;
		Rating = rhs.Rating ;
		AddressInfo.DeepCopy(rhs.AddressInfo) ;
		Orders.addAll(rhs.Orders) ;
		CcInfo.DeepCopy(rhs.CcInfo) ;
	}
			
}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Cisco
United States United States
I work as a senior solutions software architect at Cisco.

Here is my work.

Comments and Discussions