Open Source .NET Development [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Open Source .NET Development [Electronic resources] - نسخه متنی

Brian Nantz

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


Open Source Databases


There are many different Open Source databases like Berkley DB, MySQL, and PostgreSQL, just to name the more popular ones.[1] All of these databases work on multiple operating systems. When narrowing your choices for a database for your project, consider the following features:

[1] Also available are mSQL, sapDB, and Firebird.

  • Database Operating System Support

  • Open Source Community Support

  • Relational vs. Hierarchical Design

  • Feature Set

  • Scalability

  • ADO.NET Provider Support

  • Administration and Development Tools

  • Open Source License


Sleepycat Berkeley Database


Although not a relational database, the Berkeley Database engine is used in many products. Sleepycat (Chapter 3, "General Development") utilizes a Sleepycat database.

Chapter 2, "Open Source and the .NET Platform").

For a good book on Sleepycat, see:

Berkeley DB

by Sleepycat Software Inc.

SAMS

MSDE


Microsoft Desktop Engine, as was mentioned in Chapter 3, is a full-featured Microsoft product. MSDE is a scaled down version of Microsoft SQL with the limitations outlined in Chapter 3. Although it is not under an Open Source license, MSDE is freely available for integration into proprietary products. Many freely available IDEs mentioned in Chapter 3, like #Develop and WebMatrix, fully support MSDE as if it were SQL with all the Rapid Development (RAD) features. These features include drag-and-drop creation of a dataset from a database table, direct editing of tables, and data adapter wizards, just to name a few.

MySQL


Chapter 3. If your product meets these requirements, there are many administration tools featured in Chapter 3 (Figures 3.1316). Also, there is an Open Source ADO.NET data provider (Listing 10.2).

Listing 10.1. MySqlNet DataAdapter Example

using ByteFX.Data.MySqlClient;
...
public DataSet SelectRows(DataSet dataset,string connection,string query)
{
MySqlConnection conn = new MySqlConnection(connection);
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.SelectCommand = new MySqlCommand(query, conn);

adapter.Fill(dataset);
return dataset;
}

One great convenience of MySQL is that it does have a native Windows port. This makes it very easy to install MySQL on Windows (it already comes with most Unix distributions) without any dependencies.

For a great book on MySQL, see:

MySQL , Second Edition

by Paul DuBois

SAMS

Which Database to Choose?


This is a very loaded question. To adequately compare these databases would require an entire book. It is a comparison of Speed vs. Features vs. Licensing and Rapid Development (RAD). The goal of this chapter is to give a quick comparison of features and point you to other resources to learn more, with the one requirement of all database engines being Open Source and having ADO.NET support.

Chapter 3), but more importantly, you have to see how you and your team like the database. I know that sounds simple, but just download the databases, install them and a few tools, and create a very simple application to see which fits you best. But do not forgetChapter 3) do not work for you, then you will probably like PostgreSQL or MSDE.

NOTE

I have chosen PostgreSQL for the database examples in this book. The main reason is feature set and licensing. My philosophy is that most products, given enough time, grow out way beyond the intent of the original design. Therefore, you do not know at design time what you may need in the future so I usually go with a greater feature set for this reason. I may not use transactions today, but in the future I may need them, and I do not want to change databases sometime in the future. This would be a big waste of time for a development team. With regards to licensing, I always go for Open Source (so that I have the source and can change it if need be) and can use the product in a proprietary fashion to make great profits.


Cross Database Development


It has long been the dream of many marketing specifications to create an application that can be database vendor-independent. Being able to install a product at a customer's site without requiring a new database engine to be purchased is definitely a big plus. ADO.NET comes the closest of any database API I have seen to allow for standard development using disconnected Datasets, DataViews, and all that great stuff without having to know the database provider and in turn the database engine that you are talking to. The problem with this comes in performance, depending on the performance needs of your application. To get the fastest performance, most databases support stored procedures. These stored procedures are unique to every database engine, preventing the database-agnostic dream. However, the good news is that the .NET code would not have to change if designed properly, only the stored procedures. The better news is that if you do not need stored procedures and can use in-line parameterized queries, then maybe the dream can come true.

On a related note, some development teams use databases to simply store the state of their objects in a non-relational fashion. A new and very popular Open Source project just released call Gentile.NET (http://www.mertner.com/projects/gentle/) supports this out of the box very well! No custom coding is needed. (A similar concept without the relational database is also available from http://www.sourceforge.net/projects/bbooprevalence.com.) There are a few very impressive aspects of this project. First, it uses other Open Source projects covered in the book: NUnit, NAnt, and Log4NET. Second, Gentile.NET works on both Microsoft .NET and Mono! Third, there is a Visual Studio.NET plug-in for Gentile.NET for rapid development. Finally, the list of databases the framework works with is most impressive: Microsoft SQL, Oracle, PostgreSQL, MySQL, Microsoft Access, Firebird, and SQL Lite! Much can be learned from the experience of these developers in cross-platform development!


    / 275