Database
  Home arrow Database arrow Page 6 - 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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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 - Extracting Metadata from Design Tools Such As UML


    (Page 6 of 22 )

    I really wanted to be able to give you good tools for building metadata directly from UML. After much time and grief, I commiserated with one of my UML guru friends (who is a bit gnarly around the edges), and he said, “What? I’d fire anyone who took their UML to so much detail that you could directly build business objects from them. UML isn’t an eye chart!” That’s not an excuse. Okay, that’s an excuse, but it’s also a different perspective. I’ll admit the real reason I’m not giving you a good UML solution is that it’s a complex metadata source to work with, and databases are often a more appropriate metadata source.

    TIP: UML should make an excellent metadata source. Unfortunately, technical hurdles make it a difficult metadata source to use.

    Using Visio

    Visio provides a UML modeling tool, but it isn’t very good. (See Footnote 5) One of its many problems is that it quite successfully buries the UML metadata where it’s extremely hard to access. There are a couple of contorted approaches you can use to extract metadata from Visio UML. You can try to break up the XML save format. But that’s a storage format for a drawing program and has no understanding of UML. You can create XML Metadata Interchange (XMI) output if you download a special Dynamic Link Library (DLL) from MSDN (search the MSDN library for XMI and UML) (See Footnote 6). The XMI standard is an XML layout (defined in a schema) that allows for interchange of information between UML tools. To work with this file, you’ll also have to download a Document Type Definition (DTD) schema from the Object Management Group (OMG) Web site, which the MSDN article explains. A simple UML diagram with two classes, three attributes, and three operations was a 313-kilobyte (KB) XMI file. So, for goodness sake, translate it into friendly XML and don’t do code generation directly against this file!

    (Footnote 5: Visio currently stinks for UML. I remain optimistic that Microsoft will provide a good UML product.)

    (Footnote 6: You can access MSDN libraries at http://www.msdn.microsoft.com even if you aren’t an MSDN subscriber.)

    Visio also offers a rudimentary code generation feature. From the perspective of real code generation, it’s useless. It’s buggy, extremely tedious to use, and from a practical perspective just builds shells. However, there’s a third approach to extracting UML metadata from Visio lurking here. You can create your UML, generate a dummy C# project, then use reflection to extract the UML structure from these classes, and finally massage problems that occur. Wow, that’s so ugly, forget I even suggested it.

    Using Other UML Tools

    If you’re using Rational or another UML tool, you can probably create XSD schemas for the classes you define. The tool may not carry all of the information from your UML design, but it’s a start. These products generally also provide XMI support, allowing you to extract a more complete structure—if you’re willing to attack XMI’s complexities. You also may be able to export the structure to the SQL Server repository and extract it from there—again, a rather roundabout way to accomplish a simple task.

    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

    - Converting Your Excel Worksheet into a Worki...
    - 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)





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT