Return-Path: Delivered-To: apmail-incubator-geronimo-dev-archive@www.apache.org Received: (qmail 49987 invoked from network); 19 Feb 2004 18:39:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Feb 2004 18:39:18 -0000 Received: (qmail 81735 invoked by uid 500); 19 Feb 2004 18:38:58 -0000 Delivered-To: apmail-incubator-geronimo-dev-archive@incubator.apache.org Received: (qmail 81674 invoked by uid 500); 19 Feb 2004 18:38:58 -0000 Mailing-List: contact geronimo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-dev@incubator.apache.org Received: (qmail 81554 invoked from network); 19 Feb 2004 18:38:57 -0000 Received: from unknown (HELO hotmail.com) (64.4.46.86) by daedalus.apache.org with SMTP; 19 Feb 2004 18:38:57 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 19 Feb 2004 10:39:01 -0800 Received: from 210.216.114.52 by bay9-dav29.bay9.hotmail.com with DAV; Thu, 19 Feb 2004 18:39:01 +0000 X-Originating-IP: [210.216.114.52] X-Originating-Email: [gunsnroz@hotmail.com] X-Sender: gunsnroz@hotmail.com From: "gunsnroz" To: , Cc: , , , Subject: duplicate code in EWS and AXIS Date: Fri, 20 Feb 2004 03:39:00 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Thread-Index: AcPpqfluYbfUxjdNREiNthd+rpINjANaGhrw In-Reply-To: <3552.203.94.92.148.1075739644.squirrel@webmail.pair.com> Message-ID: X-OriginalArrivalTime: 19 Feb 2004 18:39:01.0536 (UTC) FILETIME=[A4A91A00:01C3F717] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, ews and axis people! After comparing the codes in EWS and AXIS, I found that many of them are duplicated. Specially, the following codes are very similar. - J2eeEmitter <--> org.apache.axis.wsdl.tojava.Emitter - J2eeGeneratorFactory <--> org.apache.axis.wsdl.tojava.JavaGeneratorFactory The other codes such as J2eexxxWriter are deprecated in EWS because the equivalent ones in Axis can be used. Like this, some modification in the axis Emitter and JavaGeneratorFactory makes the Axis code reusable and ews code simpler. The basic idea is adding some codes that override the Axis' default Java <--> wsdl nampping in derived classes. Here is the example, (details omitted for brevity) JavaGeneratorFactory.java from Axis protected void determineInterfaceName(SymbolTable symbolTable) { // ... if (entry instanceof BindingEntry) { PortTypeEntry = ... seiName = ptEntry.getName(); bEntry.setDynamicVar(JavaBindingWriter.INTERFACE_NAME, seiName); } // ... } If we add some way to override Axis' default name mapping (ptEntry.getName() in above example) like this: ///////////////////// JavaGeneratorFactory in Axis protected void determineInterfaceName(SymbolTable symbolTable) { // ... if (entry instanceof BindingEntry) { PortTypeEntry = ... seiName = getServiceEndpointInterfaceJavaNameHook(ptEntry, bEntry); if (seiName == null) { seiName = ptEntry.getName(); } bEntry.setDynamicVar(JavaBindingWriter.INTERFACE_NAME, seiName); } // ... } protected String getServiceEndpointInterfaceJavaNameHook(PortTypeEntry ptEntry, BindingEntry bEntry) { return null; } The J2eeGeneratorFactory in ews look like this: /////////////////////// J2eeGeneratorFactory in EWS class J2eeGeneratorFactory extends org.apache.axis.wsdl.tojava.JavaGeneratorFactory { // determinedInterfaceName() : no more needed. // add new method protected String getServiceEndpointInterfaceJavaNameHook(PortTypeEntry ptEntry, BindingEntry bEntry) { if (mapper == null) return null; return mapper.getServiceEndpointInterfaceName(ptEntry, bEntry); } // ... } I have modified the codes in ews and axis and it seems that almost duplicate codes in J2eeEmitter and J2eeGeneratorFactory can be removed. Uhm... I think there are pros and cons in this way. The cons: - Tightly coupling in the Axis code and ews (or other) codes The pros: - Simpler ews codes - The Axis code can be reused in other Java <--> WSDL mapping case (like JSR-181) I will discuss it more with Ias who is the Axis and ews committer. (He and I are working in the same company) I think that the code change in Axis like this should be with the consent of other Axis committers. Any comment? Jongjin/ --------------------------------------------------- Webservices Team in Tmax Soft. JSR-208 EG member. ---------------------------------------------------