分享
 
 
 

[代码生成]XMLSpy? 2005 Code Generagor

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

Products

XMLSpy
Programming
Code Generation

XMLSpy® 2005 includes a built-in code generator that generates program code bindings of XML Schema components in Java, C++, or Microsoft C#.

Code Generator

XMLSpy® 2005 now includes a built-in code generator that automatically generates Java, C++, or Microsoft C# class files based on data elements defined in an XML Schema. An overview of the simple two-step code generation process is illustrated in the following figure:

(1) Model data elements in XML Schema using the XMLSpy® 2005 Schema Editor

(2) XMLSpy® 2005 will auto-generate class files (data bindings) corresponding to elements defined in your data model

XML Schema is ideally suited for data modeling in modern software applications because it supports the concept of datatypes and object-oriented design. This enables XML Schema to bridge the gap between the relational database model and current object-oriented software design methodologies.

What is an XML Data Binding?

An XML data binding is a mapping of one or more XML data elements to a set of related software objects. Implementation of a data binding for XML data elements is required because XML is not a full programming language, in that it cannot be compiled or executed as stand-alone binary executable file. Rather, XML documents must be bound to an external software application or runtime environment such as a business-to-business application or Web service.

An XML data binding allows you to programmatically work with XML documents from within your software application via a set of simple objects. It can be thought of as an abstraction layer between an XML document and your custom application (business logic), alleviating the need for developers to understand the technical intricacies of loading, editing, and saving, an XML document using low-level XML parsing APIs.

The following figure shows a typical example of the application of a data binding in a Web Services application, located in between the inbound XML stream and custom business logic:

Today, there are many tools that create the SOAP "plumbing" - i.e. the client/server stubs and skeletons required to marshal an XML document from one process to another - yet you still must write a data binding to process the inbound XML documents within a SOAP envelope and create the appropriate XML message in response. The XMLSpy® 2005 code generator can automate the tedious process of implementing a data binding, freeing a developer to focus on implementing business logic.

Implementing an XML Data Binding

Implementing an XML data binding involves writing infrastructure code to create, read, update and delete an XML document in memory using low-level XML processing APIs such as the Simple API for XML Parsing (SAX) or the Document Object Model (DOM). In addition to the basic infrastructure methods, a data binding must include additional higher level functions/methods to validate, process, transform, and perform other common in-memory operations on an XML document. XMLSpy® 2005 automates this task by providing a simple menu item that can generate program code based on an XML Schema, as shown below:

Implementation of an XML data binding is a tedious, error-prone task, requiring dozens, and possibly hundreds of class files. For example, consider the following data model of a company organization chart, which consists of data elements such as Office, Department, Person, Address, etc. (Click on screenshot to enlarge).

In this example, the generated program code data binding consists of 24 classes and thousands of lines of code. Click to download and view the auto-generated code in for this sample application in Java, C++, or Microsoft C#, then select "Save Target as..." to save and view the files.

XMLSpy® 2005 Code Generation Features

The following is a summary of XMLSpy® 2005 code generator features:

Default templates to automatically generate class definitions corresponding to all declared elements or complex types that redefine any complex type in your XML Schema

Preservation of class derivation as defined by extensions of complex types in your XML Schema.

Support for Java, C++, and Microsoft C# program code output.

Support for industry standard XML processing APIs including Microsoft MSXML, Java API for XML Processing (JAXP), and Microsoft System.XML

The generated C++ output includes a Visual Studio 6.0 project file; the generated Java output is includes a Sun Forte for Java project file and Apache Ant build script; Microsoft C# output includes a Visual Studio.NET project file.

Output code is completely customizable via a simple yet powerful template language that gives full control in mapping XML Schema built-in data-types to the primitive datatypes of a particular programming language.

You can easily replace the underlying parsing and validating engine, customize code according to your company's writing conventions, or use different base libraries such as Microsoft Foundation Classes (MFC) and Standard Template Library (STL).

Ability to build your own templates to automate the generation of anything imaginable, e.g., SQL scripts, ASP or WML code.

Generation of project files for Borland C# Builder and other third party IDEs including MONO.

The following screenshot shows just how easy it is to generate an XML data binding using XMLSpy® 2005 Enterprise Edition:

XMLSpy® 2005 Code Generation Benefits

XMLSpy® 2005's schema editor is a well equipped software modeling and prototyping tool that allows XML applications to be rapidly prototyped at a high level in XML Schema and then automatically generated. Changes to an application's XML Schema content model can be immediately reconciled with a software implementation simply by re-running the code generator. Built-in code generation frees software developers from the mundane task of writing low level infrastructure code, enabling them to focus on implementing critical business logic. By automatically generating a programming language binding, XMLSpy® 2005 accelerates project development time from initial design to final implementation, resulting in substantial cost savings and time to market advantages.

Enhanced Customization Options

The XMLSpy® 2005 code generator now supports the use of Apache Xerces (a popular XML parser) and Standard Template Library (STL), as well am additional support of XML Schema simple types in Java/C#/C++ generated output code.

Did you know that Altova MapForce™ 2005 auto-generates program code for custom XML / database / EDI data integration projects? MapForce™ 2005 and XMLSpy® 2005 are highly complementary - using them together, a software developer could auto-generate much of the code needed for an XML-enabled application, including the code to marshal data from different sources.

To learn more about the comprehensive data integration and code generation capabilities of Altova's highly complementary products, check out the Altova Enterprise XML Suite 2005 and Professional XML Suite 2005. These specially-priced suites bundle Altova's award-winning products to meet all your XML development needs.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有