[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-user
Subject:    RE: Generated Classes and Overriding
From:       "David, Sam" <sam.david () pearson ! com>
Date:       2006-05-16 14:50:59
Message-ID: 34B80AFC74D7914EAF5F70B69CC8B1D2140F94C6 () iowacexch1 ! ic ! ncs ! com
[Download RAW message or body]

Foo and CustomerFoo are both isolated with separate namespaces. In fact
XMLBeans generates these classes in separate packages. Heres what I want to
do

 

1. The Class Foo lives in a package and has a method that returns a type
Bar. The class Bar also lives in the same package as Foo.

 

2. The Class CustomerFoo extends Foo and overrides the method that returns
the type Bar to return the type CustomerBar. The CustomerBar extends Bar to
include new variables. Both these classes live in a separate package.

 

The schemas are designed and namespaced to achieve this. XMLBeans generates
that right classes based on the hierarchy and in the right packages. Here is
the issue

 

I want this common OO concept enforced.

In FOO I have a method:

com.pearson.sorm.test.Bar getBar();

 

In CustomerFoo I want to have:

com.pearson.sorm.test.Bar getBar() 

that overrides the method in Foo but returns CustomerBar...(CustomerBar
extends Bar)

 

Remember that the schemas are namespaced to achieve this and the java
namespace(packages that are generated) allows this. What I see is that
instead of getBar()....XMLBeans decides that there is a namespace conflict
and generates the method getBar2() that essentially prevents overriding.

 

--Sam

 

 

 

 

 

 

  _____  

From: David, Sam 
Sent: Thursday, May 11, 2006 5:18 PM
To: 'user@xmlbeans.apache.org'
Cc: David, Sam
Subject: Generated Classes and Overriding

 

 

 

 

 

 

 

 

****************************************************************************


This email may contain confidential 
material. If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network.

 ***************************************************************************


 


**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:st1="urn:schemas-microsoft-com:office:smarttags" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman";}
span.EmailStyle17
	{mso-style-type:personal;
	font-family:Arial;
	color:windowtext;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Foo and CustomerFoo are both isolated with
separate namespaces. In fact XMLBeans generates these classes in separate packages.
Heres what I want to do<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>1. The Class Foo lives in a package and has
a method that returns a type Bar. The class Bar also lives in the same package
as Foo.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>2. The Class CustomerFoo extends Foo and \
<b><span style='font-weight:bold'>overrides</span></b> the method that returns the \
type Bar to return the type CustomerBar. The CustomerBar extends Bar to include new
variables. Both these classes live in a separate \
package.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The schemas are designed and namespaced to
achieve this. XMLBeans generates that right classes based on the hierarchy and in
the right packages. Here is the issue<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I want this common OO concept \
enforced.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>In FOO I have a \
method:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>com.pearson.sorm.test.Bar \
getBar();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>In CustomerFoo I want to \
have:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>com.pearson.sorm.test.Bar getBar() \
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>that overrides the method in Foo but
returns CustomerBar...(CustomerBar extends Bar)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Remember that the schemas are namespaced
to achieve this and the java namespace(packages that are generated) allows
this. What I see is that instead of getBar()....XMLBeans decides that there
is a namespace conflict and generates the method getBar2() that essentially
prevents overriding.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>--Sam<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> <st1:PersonName
w:st="on">David, Sam</st1:PersonName> <br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, May 11, 2006 5:18
PM<br>
<b><span style='font-weight:bold'>To:</span></b> '<st1:PersonName \
w:st="on">user@xmlbeans.apache.org</st1:PersonName>'<br> <b><span \
style='font-weight:bold'>Cc:</span></b> <st1:PersonName w:st="on">David,  \
Sam</st1:PersonName><br> <b><span style='font-weight:bold'>Subject:</span></b> \
Generated Classes and Overriding</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span \
style='font-size:12.0pt'>****************************************************************************
 <o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>This
email may contain confidential <br>
material. If you were not an intended recipient, <br>
Please notify the sender and delete all copies. <br>
We may monitor email to and from our network.<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span \
style='font-size:12.0pt'>&nbsp;***************************************************************************
 <o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

</div>


<P 
align=left>**************************************************************************** \
 </P>
<P align=left>This email may contain confidential <BR>material. If you were not 
an intended recipient, <BR>Please notify the sender and delete all copies. 
<BR>We may monitor email to and from our network.</P>
<P 
align=left>&nbsp;*************************************************************************** \
 </P>
<DIV>&nbsp;</DIV>
</body>

</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic