An Extended View of Data: Data Repositories


Those of you who have worked on an application that used a database as its data source have a good idea of what a data repository is. On the mainframe, a common data repository may have been a relational (e.g., DB2) or hierarchical (e.g., IMS) database that your application accessed. The description of a data repository would then begin with the same basic characteristics of a database: a grouping of data that supports systematic access.

Although the database is a great common choice, it's not the only data repository choice. There are other data repositories available to the Windows/Web developer.

Note  

On the Windows platform, it is common to have a database available to serve as your data source. In a Microsoft-centric environment, the database product would typically be SQL Server. The .NET platform offers the technology ADO.NET for database access. When you combine ADO.NET with the appropriate .NET Framework namespaces ”System.Data, System.Data.Common, System.Data.SqlClient, and System.Data.SqlTypes ”you are ready to take full advantage of your data repository of choice.

Cross-Reference  

I further discuss the System.Data namespace, the ADO.NET technology, and the SQL Server database in Chapter 11.

Introducing the Data Repositories

Some of the following product and technology names will be new to you. It is not my intent to provide a tutorial to each individual data repository. Rather, I want to make sure that you are simply aware of the choices that are available to you for data. As you enter into .NET development and begin to create Windows- and Web-based applications, being somewhat familiar with these products and technologies will be to your advantage. Please take a look at the following list of Windows-based data repositories:

  • Active Directory (a Windows directory service)

  • Microsoft's Web Storage System [6] (WSS) (a Web-accessible database)

  • XML documents (further discussed in Chapter 12)

  • Screen scraping (further discussed in Chapter 13)

  • XML Web services (further discussed in Chapter 13)

Some will prefer that the preceding list be more inclusive. At the same time, some will argue against the inclusion of one entry or another. Nevertheless, the main point here is that products and technologies are available that support the organization and retrieval of information (data). These products and technologies more closely resemble a database than a text file. Yet, they are not normally referred to as databases; hence, I call them data repositories. Oh, I almost forgot one other very important point: The .NET platform fully supports your programmatic access to these data repositories through appropriate .NET Framework namespaces.

Note  

In Chapter 3 in the section "Microsoft Office and Notepad," I introduced the Microsoft Word and Excel products and mentioned that their object model is exposed for programmatic use. When you incorporate Microsoft documents into your programming logic, you are using these documents as data repositories.

Know this one fact, before I do harm and injustice to all: The technologies surrounding Active Directory and WSS are extensive enough to fill several thick textbooks . Having said that, let's briefly peek at the support that .NET provides for these data repositories.

Active Directory As a Data Repository

You have worked with directories before on the mainframe. You most likely used the term "catalogs" to refer to these directories. The catalog was used (indirectly) each time you wanted to create or retrieve a cataloged dataset. Recall that the mainframe environment basically had two types of catalogs: master catalogs and user catalogs. When retrieving a cataloged dataset, the system would first search the one master catalog and then any one of the user catalogs to look up the appropriate dataset pointer. The most recent "type" of cataloging system implemented on the mainframe was the Integrated Catalog Facility (ICF) catalog system.

The Windows 2000 environment offers a catalog/directory-type system as well: Active Directory. You can use Active Directory to "locate" data (similar to the mainframe catalog). Active Directory then goes on from there ”practically without end ”being able to store and retrieve all types of information (not just datasets). For example, an organization might use Active Directory to organize and store information for users, groups, computers, printers, and so on. As a Windows directory service, you would generally look to this product to store and retrieve static data (as an alternative to using a relational database, for example). Active Directory's data is stored in a treelike structure.

Tip  

Active Directory uses the term "domain" to refer to both the physical domain controller and a logical relationship-type grouping of data. This supports the use of the Active Directory schema. The groups of related domains then become domain trees (in reference to Active Directory's hierarchical storage design). Groups of trees are then called a forest.

If you find that your Windows/Web application has a need to access this particular data repository, you will be able to leverage the .NET Framework through several managed objects (in this case, classes and enumerations).

Note  

When you work with Active Directory, it is common to also use Active Directory Services Interfaces (ADSI). The .NET Framework provides classes that are able to use the features of ADSI. This provides for flexible Active Directory programmatic support. References are provided at the end of this chapter in the "To Learn More" section for your convenience.

If you take a look at the .NET Framework's System.DirectoryServices namespace, you will notice an extensive list of classes and enumerations. Of these, I suggest that you start with the two classes DirectoryEntry and DirectorySearcher . The methods and properties exposed by these two components will quickly enable you to add ADSI support to your application.

Note  

A general understanding of Active Directory should be considered a prerequisite to any attempted use of the System.DirectoryServices namespace.

Simply put, you would use the .NET System.DirectoryServices.DirectoryEntryclass to manipulate information in your Active Directory tree. When you want to query your Active Directory, the .NET System.DirectoryServices.Directory-Searcher class will be your choice. Through the use of these two classes, you will end up using additional classes (and the enumerations) from the System.DirectoryServices namespace.

The Web Storage System As a Data Repository

Nowadays, practically everyone has had the experience of sending e-mail, both in their personal and professional life. Similarly, it is becoming commonplace for organizations to expose calendar/scheduling, online forms, and voting/polling features to employees , all online. Additionally, we have all grown comfortable with sharing electronic versions of documents. A grouping of these features would fit nicely into our description of a data repository. Microsoft's Web Storage System (WSS) is exactly that. The WSS is a hierarchical database that supports the storage of unstructured and semistructured data.

Two major products take advantage of the WSS technology: Microsoft's Exchange Server 2000 (or Exchange) and Microsoft's SharePoint Portal Server 2001 (or SPS). The WSS is bundled with Exchange and SPS. [7] Exchange is a very powerful messaging system. It uses the WSS to store e- mails , calendars, contacts, and other related data. SPS, on the other hand, allows organizations to extend the WSS to include advanced document management, searching, and collaboration features.

Tip  

Given the enormity of these three topics (Exchange, SPS, and the WSS), I strongly suggest that you take advantage of the related references provided in the "To Learn More" section at the end of this chapter.

Your typical configuration (as a Microsoft-centric shop) would have Microsoft Outlook client stored on each employee's desktop. Each person's local Outlook software would then have the appropriate options set to use the central Microsoft Exchange Server (for sending and receiving e-mails, scheduling, and so forth). Optionally, Outlook Express could be used through an Internet browser. SPS also has a browser-based user interface available. Exchange and SPS both expose fully customizable interfaces.

You're creating your .NET application and now you wish to consume data that's stored in the WSS. After all, what good is a data repository if you can't access the data? Fear not, .NET provides support for those who wish to access the WSS.

When you seek out .NET Framework support for various tasks , you will search for .NET namespaces. Take this case as an example. Say that you read about Microsoft Exchange Server and its e-mail storage functionality. Then, when you seek guidance, a well-intentioned Windows developer may point you in the direction of the Collaborative Data Objects (CDO) and CDO for Windows NT Server (CDONTS) technologies. So, your search begins.

Then, you come across the .NET Framework namespace System.Web.Mail . You are certain that you have hit the jackpot . After all, you see the word "Mail" in the namespace and you see a new form of the CDO acronym. Then you read further.

You discover that with this namespace, you can construct and send messages using the Collaboration Data Objects for Windows 2000 (CDOSYS) component. There is just one catch: CDOSYS and the System.Web.Mail namespace directly support Simple Mail Transfer Protocol (SMTP) [8] and Network News Transfer Protocol (NNTP). Furthermore, the component that fully exposes the Exchange object model is CDO for Exchange 2000 Server (CDOEX). [9] SPS uses a different component to expose its object model: Publishing and Knowledge Management Collaboration Data Objects (PKMCDO).

Tip  

Microsoft offers a Software Development Kit (SDK) for both SharePoint Portal Server and Exchange Server. See the "To Learn More" section at the end of this chapter.

So, where is the .NET support for the WSS? Fortunately, the .NET platform offers a feature called COM Interop . To use this feature, you simply register and reference the appropriate COM DLL. Basically, you then are able to programmatically access (in your .NET managed code) the public methods and properties exposed by the COM DLL. The components mentioned previously (CDOEX and PKMCDO) have a COM DLL associated with them. The "To Learn More" section at the end of this chapter will help you in your further pursuit of information about the WSS.

Cross-Reference  

I discuss COM Interop further in Chapter 20.

I have discussed two types of data repositories in this section. The discussion supported an extended view toward the topic of data. In the next section, I discuss yet another type of data: metadata. I am sure that you will find this to be an interesting discussion. By the way, to illustrate the support that .NET provides for metadata, you will get into some sample code.

[6] Some refer to the Web Storage System (WSS) as the Exchange Server Information Store. Good luck with keeping up with the names of Microsoft's products and technologies!

[7] In Chapter 2 (in the section ".NET Is a Group of Enterprise Servers"), Exchange Server and SharePoint Portal Server were included in the list of .NET Enterprise Servers.

[8] I discussed these network protocols in Chapter 3 in the section "Network Protocols and the URL."

[9] CDOEX is a superset of CDOSYS.




COBOL and Visual Basic on .NET
COBOL and Visual Basic on .NET: A Guide for the Reformed Mainframe Programmer
ISBN: 1590590481
EAN: 2147483647
Year: 2003
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net