Database
  Home arrow Database arrow Page 2 - Extracting Metadata
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Extracting Metadata
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 17
    2004-09-08

    Table of Contents:
  • Extracting Metadata
  • Introducing the Process
  • Using Schema Definitions Such As XSD
  • Extracting Metadata from Databases Such As SQL Server
  • Retrieving Metadata from External Sources
  • Extracting Metadata from Design Tools Such As UML
  • Extracting Metadata from Existing Applications and Source Code
  • Why Extract Metadata?
  • Establishing Your Own XML Design Guidelines
  • Introducing the Tools for Metadata Extraction
  • Understanding XSD’s Role in Code Generation
  • Exploring the Structure of an XSD
  • Working with SQL-92 Databases (SQL Server)
  • Understanding the Tool Architecture
  • Working with Information Schema Views
  • Using Constraints
  • Modifying Mappings
  • Retrieving Stored Procedure Recordsets
  • Retrieving Identity Columns
  • Creating Freeform Metadata
  • Using Skip Attributes
  • Merging Metadata

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Extracting Metadata - Introducing the Process


    (Page 2 of 22 )

    The code generation process needs a single monolithic XML metadata input. But a monolithic metadata file is hard to manage. Different people may perform different metadata extraction and code outputting tasks. Chapter 3 shows how to make code generation a granular process. It makes no sense to create a granular process and then have it rely on a monolithic file that everyone is trying to modify. So, I’ll show you how to merge individual XML metadata into a transient monolithic file in the “Merging Metadata” section of this chapter.

    Figure 2-2 is a high-level view of metadata. On the right, the single monolithic XML metadata file is composed of four segments. You might add another segment or two, such as report definitions, but you’ll have a small number of high-level sections in the XML metadata document.

    The monolithic XML metadata file is created on individual developers’ machines and is transient. You’ll output it to disk for debugging, but you don’t want to put it under source control. One of the differences between hacking around with code generation and making it a conscious process is intelligently incorporating source control. By keeping only the individual metadata files under source control, you gain important flexibility for your team.

    Seeing all these discrete steps might be making you nervous, particularly if you’ve worked with the tedious process of generating strongly typed DataSets in Visual Studio. I’m committed to one-click code generation smoothly integrating these granular processes. You’ll see details of one-click activation of the multistep code generation process in Chapter 3, so you’ll need to trust me on this and postpone testing these tools until then when you’ll have the metadata, the templates, and the generation tool.

    Understanding Metadata Sources

    Metadata is all of the changeable information you need to build source code. This is the bulk of what changes between your applications. Because the easiest metadata to visualize is from databases, I’ll often talk about metadata in relation to data structures—database fields and columns. Clearly, not all metadata is related to data structures.

     dollard

    Figure 2-2. Metadata sources

    If metadata is literally any data you need to build your application, you can get it from anywhere. It makes no difference to later processing where you get the metadata. There are at least seven kinds of metadata sources as follows:

    • Schema definitions such as XSD

    • Databases such as SQL Server

    • Manually entered freeform metadata

    • Web Services via Web Service Description Languages (WSDLs)

    • External sources, such as mainframes, Excel, and so on

    • Design tools such as Unified Modeling Language (UML)

    • Existing applications and source code

    You can further divide these types into categories based on how you extract the metadata. You extract using .NET if the source has a programmatic interface such as databases, external sources, and existing applications. You retrieve it using XSLT if it’s an XML source such as XSD, WSDL, and XMI output from UML diagrams (see Footnote 1). You can also manually enter metadata by typing in the XML. As you can see in Figure 2-2, regardless of the process, you create a series of individual files.

    (Footnote 1. I win Bingo with five acronyms in one sentence! XML is self-describing data whose structure can be defined using an XSD schema. Appendix A discusses XML and XSD. WSDL is basically a specific subset of XML used to describe Web Services. UML is the Unified Modeling Language and is a diagramming standard intended to improve communication during software design processes. XMI is another subset of XML that’s designed for exchanging UML information.)

    You can also categorize metadata sources by the high-level element that contains them in the monolithic metadata file. There are only a few broad cate-gories—such as data structures describing data, class structures describing data and functionality, and User Interface (UI) structures describing UI details.

    Because there are so many metadata sources, I could write a very long chapter on metadata extraction, but it would be tedious and repetitive. So, I’ll tell you a little about each of these sources and then follow up with a deeper discussion of three metadata sources: XSD schemas, SQL-92 databases (including SQL Server), and freeform metadata. These three sources represent the three key approaches to metadata extraction: XSLT templates, .NET programs, and manual entry. You’ll have to develop your own extraction tool for the other five metadata source types (and any others I omittted), but this chapter will give you a significant head start on writing them.

    This is from Code Generation in Microsoft .NET, by Kathleen Dollard (Apress, ISBN 1590591372). Check it out at your favorite bookstore today. Buy this book now.

    More Database Articles
    More By Apress Publishing


     

    DATABASE ARTICLES

    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)
    - Creating a Database Project in VS 2005

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT