Take A Peek at Dali - ' Intelligent Data Access ' (
Page 2 of 3 )
Imagine what would happen if your CTO had a hissy fit with a software vendor, and decided to scrap the DBMSs the company uses. Then she gave you three days to migrate all applications to that new database solution. Or, in a kinder, gentler corporation, you discover that you have to add support for a new database without warning. If you were using Revelation Technologies' Dali 2.0, that task wouldn't be nearly so daunting, because Dali lets you work without close ties to the specific database product.
Dali promises greater separation between programmers and the databases they use. The software component claims to enable developers to write database-aware applications with less than half the database-related source code required by traditional methods. For the most part, the promise is kept. In one fell swoop, Dali reduces the pain of vendor-specific database vagaries, makes your code more portable, and leverages advanced database features. Overall, Dali offers an excellent value.
ADVERTISEMENT
Dali provides a generic VB- or C#- database interface, so you don't have to modify application code to use the features of your chosen DBMS. Though not its primary goal, Dali can also auto-generate database access code, once the product can see your database schema. I was able to do this in minutes, and then copy and paste generated code into my application. This feature alone can help maintain the integrity between database schema and database access code.
Once you master the Dali event model, you can explore Dali's other benefits, such as not relying on your database's event model — a boon in maintaining data integrity and reducing unnecessary database access. Dali has support for multiple technologies (such as ASP.NET), deep versus shallow loading, and the usual database features (such as transactions, n-tier environments, blobs, and concurrency management) — but what I really liked about Dali is its programmer friendliness.
Dali: A Programmer's Friend
Dali really helps programmers. DBAs and programmers often have different needs. For example, a DBA might use underscores in table and column names, but the team's programmer wants to use a different naming convention. Using the C# code in Listing 1 (Dali also supports VB), the programmer can replace the unwieldy table name acme_customers and instead use a more object-oriented name, Customer.
Listing 1: Alias for table name
[DaliClass (TableName = "acme_customers")]
public class Customer
{
// class definition
}
The same technique can be used for column names.
Dali also provides data type conversions. If a column is defined as storing int, and you attempt to write a decimal number, Dali converts the decimal value to an int. Blobs are fully supported, as well as class serialization.
ASP.NET Workflows
Dali supports important Web technologies, such as ASP.NET. ASP.NET pages are compiled into classes, and the page classes contain fields for text boxes, list boxes, and other user interface controls that display and collect data. Dali can facilitate the transfer of data between objects and tables.
You can use the code in Listing 2 to associate database columns with specific ASP.NET visual controls.
State and Events
Using the abstract base class, DaliObject ties your classes into Dali, but this can be weighed against the benefits you gain from access to the state model. Listing 3 shows how to set up the event model.
Listing 3: Getting ready for events
public string name_;
public string Name
{
set
{
SetModified ("Name", name_, value);
name_ = value;
}
get
{
return name_;
}
}
Listing 3 shows a SetModified method that you can call when you change an object. The value or property being changed is the Name field. The second argument indicates the old value prior to the change. The new value for Name is supplied in the third parameter. Anyone who wants to change the value of Name can call this method and cause an associated event to be emitted by Dali. This is a powerful feature.