The code archive for the Songhay Namespace is available at CodePlex.com in the Songhay System Data Access Framework.
This document summarizes the design goals and designer intentions behind the Songhay namespace, written in C# for .NET 2.0.50727. The Songhay namespace is the ‘thin layer’ at the bottom of all Songhay System .NET application layers. The contents of this namespace attempts to not make the mistake of providing functionality that is already available in .NET. Rather, the Songhay namespace contains definitions that assert specific purpose over the general purpose of the .NET framework.
The specific purpose of the Songhay namespace is governed by these strong words:
The image of the Visual Studio 2005 project, shown at left, shows these strong words. Apart from Xml, the rest of this document discusses each of these words in turn. For Xml, do see “Songhay.NET: An Overview of the Songhay XML Namespace.”
The strong word Framework in this static class indicates the .NET Framework. The assertion here is that the primal experience with .NET Framework is through a console—through the command line. The following table showing the member of this class reflects this assertion:
RunConsoleCommand()
|
This member is merely a wrapper for CMD /C, based on code by S. Senthil Kumar. It returns a System.String. |
These classes are concerned with extracting meta-data from what is called here a Framework Assembly, the *.DLL file containing complied .NET code. Originally, this was intended for populating the customary About… dialog box for Windows Forms applications. This proved to still be useful in spite of such a dialog box shipping with Visual Studio 2005.
GetAssemblyInfo()
|
Returns a string formatted with It is a server-friendly wrapper for |
This definition combines data from the Assembly.GetCustomAttributes Method and other members of the System.Reflection namespace. It was originally designed for use in Windows Forms applications but, through Songhay.FrameworkAssembly (see above), can be used in Server applications when reading “plain old objects” directly is not advantageous.
AssemblyTitle
|
Attempts to return AssemblyTitleAttribute as a string. When this is null or empty, returns Assembly.CodeBase as a string. |
AssemblyVersion
|
Returns AssemblyName.Version as a string. |
AssemblyVersionDetail
|
Returns AssemblyName.Version.Major and AssemblyName.Version.Minor in a formatted string. |
AssemblyDescription
|
Attempts to return AssemblyDescriptionAttribute as a string. Failure returns String.Empty. |
AssemblyProduct
|
Attempts to return AssemblyProductAttribute as a string. Failure returns String.Empty. |
AssemblyCopyright
|
Attempts to return AssemblyCopyrightAttribute as a string. Failure returns String.Empty. |
AssemblyCompany
|
Attempts to return AssemblyCompanyAttribute as a string. Failure returns String.Empty. |
This defines helper routines providing disk file functionality not known to be available in the .NET in general and the System.IO namespace in particular.
FileName()
|
Returns the file name based on the specified path and This member returns |
PathRoot()
|
Returns the directory root based on the specified path and This member returns |
This defines a response to the TryParse() methods for the new .NET 2.0 Nullable Types. This class definition also recognizes “Unix Time.”
DateTimeFromUnixTime()
|
Converts Unix time stamps to System.DateTime. |
DateTimeToUnixTime()
|
Converts the current time or a specified System.DateTime to a Unix time stamp. |
ParseBoolean()
|
Returns a Nullable Boolean based on the specified System.Object. Failure returns a Nullable with HasValue == false. |
ParseByte()
|
Returns a Nullable Byte based on the specified System.Object. Failure returns a Nullable with HasValue == false. |
ParseDateTime()
|
Returns a Nullable DateTime based on the specified System.Object. Failure returns a Nullable with HasValue == false. |
ParseDateTimeWithFormat()
|
Returns a System.String based on the specified System.Object and date-time format expression. Failure returns null. |
ParseDouble()
|
Returns a Nullable Double based on the specified System.Object. Failure returns a Nullable with HasValue == false. |
ParseInt32()
|
Returns a Nullable Int32 based on the specified System.Object. Failure returns a Nullable with HasValue == false. |
This definition recognizes the importance of REST for Windows “rich” clients—starting with Windows Forms. As of this writing, the HTTP verbs get and post are recognized here. Additionally, the concept of the XML post is implemented. This definition depends on the System.Net.HttpWebRequest class.
Get()
|
Returns the result of an HTTP get in a System.String based on the specified resource location. You have the option of supplying proxy server information with a bypass switch. |
Post()
|
Returns the result of an HTTP post in a System.String based on the specified resource location and post data. You have the option of supplying proxy server information with a bypass switch. |
XmlPost()
|
Returns the result of an HTTP post in a System.String based on the specified resource location and post data. The post data is assumed to be an XML fragment. You have the option of supplying proxy server information with a bypass switch. |
The Songhay.Xml namespace is overviewed in another document, “Songhay.NET: An Overview of the Songhay XML Namespace.”
As of this writing, the Songhay and Songhay.Net namespaces both ‘violate’ internationalization as indicated by the SpecifyIFormatProvider error. This is a typical, North American oversight that will be addressed in future!
The Songhay.Net namespace gets the AvoidNamespacesWithFewTypes error. Today, this error is considered an encouragement to develop the Songhay.Net namespace. For example, the case of using security credentials other than the default network credentials has yet to be implemented.