Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 10037 invoked from network); 6 Apr 2005 20:37:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2005 20:37:15 -0000 Received: (qmail 84864 invoked by uid 500); 6 Apr 2005 20:37:04 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 84855 invoked by uid 500); 6 Apr 2005 20:37:03 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 84836 invoked by uid 99); 6 Apr 2005 20:37:03 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO,HTML_60_70,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp.corp.harris.com (HELO mlbe2k2.cs.myharris.net) (137.237.104.160) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 06 Apr 2005 13:37:03 -0700 Received: from mlbmx2.cs.myharris.net ([137.237.90.74]) by mlbe2k2.cs.myharris.net with Microsoft SMTPSVC(5.0.2195.6713); Wed, 6 Apr 2005 16:37:00 -0400 Received: by mlbmx2.cs.myharris.net with Internet Mail Service (5.5.2657.72) id ; Wed, 6 Apr 2005 16:37:00 -0400 Message-ID: From: "Soti, Dheeraj" To: "'axis-user@ws.apache.org'" Subject: Which is a better approach to avoid polymorphism and inheritance Date: Wed, 6 Apr 2005 16:36:50 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C53AE8.5C8FF60B" X-OriginalArrivalTime: 06 Apr 2005 20:37:00.0420 (UTC) FILETIME=[62321440:01C53AE8] X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C53AE8.5C8FF60B Content-Type: text/plain Hi, I have class structure like as shown below. I am using doc/literal wrapped style and I don't want to expose concepts like polymorphism, inheritance and overloading in my service methods. There are two ways to handle this: * Define two different complex elements for each type of content. The advantage is its very clear and simple. The disadvantage is that there are many calls like findById, findByHouseId, findByName etc. So I'll end up writing duplicate set of calls for each type of content * Define a single complex element with union of the fields from both and introduce a field to store type. The advantage is that I only need single set of calls. The disadvantage is the additional type. There is a saying that "Adding type means killing your object". I understand that this is not really axis related question but I will highly appreciate if some would like to share his experience with me. Thanks Dheeraj Soti Content | ----------------------------------------- | | CommercialContent ProgramContent ------_=_NextPart_001_01C53AE8.5C8FF60B Content-Type: text/html Content-Transfer-Encoding: quoted-printable Which is a better approach to avoid polymorphism and = inheritance

Hi,

I have class structure like as shown = below. I am using doc/literal wrapped style and I don't want to expose = concepts like polymorphism, inheritance and overloading in my = service methods. There are two ways to handle this:

  • Define two different complex = elements for each type of content. The advantage is its very clear and = simple. The disadvantage is that there are many calls like findById, = findByHouseId, findByName etc. So I'll end up writing duplicate set of = calls for each type of content
  • Define a single complex element with = union of the fields from both and introduce a field to store type. The = advantage is that I only need single set of calls. The disadvantage is = the additional type. There is a saying that "Adding type means = killing your object".

I understand that this is not really = axis related question but I will highly appreciate if some would like = to share his experience with me.

Thanks

Dheeraj Soti


         &nb= sp;           &nb= sp;    Content
         &nb= sp;           &nb= sp;       |
         &nb= sp; -----------------------------------------
         &nb= sp; = |            = ;            = ;               |
         = CommercialContent      =         ProgramContent

------_=_NextPart_001_01C53AE8.5C8FF60B--