First a pre requisite:
You need to have asp.net Ajax installed.
Get it at:
http://ajax.asp.net
Then we need to set up the database, there are some scripts included with the startersite.
These are located in:
SubSonicStarter\App_Data\Scripts
To be able to execute these scripts you will need to create a database.
This can be done through Enterprise Manager or through other sql server management tools.
The StarterSite is set up to use 2 different databases 1 for membership and 1 for the StarterSite Data itself.
Personally I would use only one database, but if you want to make 2 seperate databases that will work ok as well.
The original scripts of the starterkit have 2 main problems:
1 - The subsonic script doesn't support SQL Server 2000
2 - They don't contain the sample data.
To resolve these issues I have created 2 files to resolve the problem.
From the SubSonicStarter\App_Data\Scripts directory execute the:
Membership.sql
This is to setup the membership part.
After that run:
http://fnmstudios.net/blog/code/Subsonicv2/SubsonicStarterKit%20v2.01%20SQL%202000%20Membership%20Content%20Script.txt
To add the roles + users used by the StarterSite.
After that set up the StarterSite itself by running:
http://fnmstudios.net/blog/code/Subsonicv2/SubSonicStarterKit%20v2.01%20SQL%202000%20Script.txt
Last but not least, Edit the web.config file connectionstrings setting to be something like this:
<connectionStrings>
<clear/>
<add name="CMS" connectionString="Data Source=(local);Initial Catalog=SS_StarterSite;Integrated Security=SSPI;" />
<add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=SS_StarterSite;Integrated Security=SSPI;" />
</connectionStrings>
Where SS_StarterSite can be replaced with your chosen Database Name :)
I hope that this will get you started with the SubSonic StarterSite on Ms SQL Server 2000.
Ok, so what is Windows Live Mail Desktop ?
Windows Live Mail, formerly known as Windows Live Mail Desktop is the new Mail Client from Microsoft which is their replacement for Outlook Express (supplied with Windows XP) and Windows Mail (supplied with Vista).
What does it do ? And how well does it do it ?
Well the same thing Outlook Express does only more :)
- Synchronization with Windows Live Contacts
- It uses the central contacts list you also use in Hotmail + Live Messenger (MSN), so update one of those and this will follow and vice versa, there is also a nice interface to manipulate your contacts with Avatars for better recognitino and extra information (contact also on Messenger etc.)
- Support for RSS feeds, which requires and uses Internet Explorer 7's RSS capabilities, including the ability to reply directly via email to the author of an item that appears in an RSS feed, as well as multiple feed aggregation into a single folder
- Haven't tried this out yet since I'm still a hold out on IE 7
- The usage of Emoticons in e-mails and other functions
- Some will call this a non feature but hey I like it :)
- In-line spell checking
- Always good to have a spell checker running :)
- Separate inbox folders for different POP accounts
- It has seperate folders for your e-mail accounts by default but it also has a united folder for all email, this is just an extra way of getting to your e-mail faster.
- SPAM / Phishing Filter
- You know you want it :) It has been a bit too aggressive on my accounts but I don't really mind that too much. Just make sure you check your SPAM folder every now and then.
- Blog integration
- Haven't tried it out yet. My guess this is Live Spaces only
- Reply with IM (MSN)
- I like it especially when it's coupled with offline messaging, you can just reply to e-mails or the one who sent you the email by instant messaging which can be preferred especially when the person is online and you want a clarification or something else.
- Really fast search in Emails
- I missed this in Outlook / Outlook Express so much.
- Minimize as tray icon function
- Saves room in the taskbar + uses very little memory like that.
- Good integration with Hotmail accounts
- How I hate the slowness of the new Windows Live Hotmail interface compared to this nice desktop interface. No longer do I have to sort to get to the right email form 4 years back :P
- Upgraded interface
- Calendar integration
- Online Live Calendar / Hotmail calendar integrated.
- Import your settings from Outlook Express
- Integration with Windows Live Messenger
- Send IM's, view Avatars in the e-mail view pane
- More intelligent show Images function
- You already viewed the Image once, oh well then you don't have to say you want to view it the next time you open the e-mail
- Use off color scheme's
- Doesn't do much for me but I'm sure some others will like it :)
What's cool about it ?
All the things listed above :) and the fact that nobody seems to be talking about it yet :)
What isn't cool about it ?
- It's memory usage can get a little high, I think 74 MB was my maximum usage, which is a bit much for a lightweigth e-mail client.
- No direct support for Exchange Servers (Outlook only feature)
- It's still in Beta
- It might get Ad supported :(
- You have to log into it using what seems to be a passport account, this means one extra enter / mouse click on your part. (can be disabled in the settings)
Verdict
This will be my new e-mail client for home / private mail usage.
For work I will probably stick with Outlook for the Exchange integration and that's probably just how Microsoft intends it to be.
If it doesn't get back the ads in the interface this will be the new default mail client for a lot of people.
Where do I get it ?
It seems not every browser will show the same ideas.live.com so here is the direct download link:
http://g.live.com/1rebeta/WLMC_EN
SubSonic Vs dOOdads Vs ActiveRecord
Let's meet our contenders:
dOOdads
An ORM framework which was provided by the people who also gave us MyGeneration.
It's built with a couple of things in mind:
- Ease of use
- Supporting a large amount of DBMS systems
Summary
MyGeneration presents dOOdads, an elegant .NET architecture available in C# and VB.NET and capable of supporting any .NET managed data provider. Currently dOOdads are available for Microsoft SQL, Oracle, Firebird, Access, PostgreSQL, VistaDB, SQLite, and MySQL.
Castle's ActiveRecord
ActiveRecord is the DAL which is supplied with the Castle project.
Summary
The Castle ActiveRecord project is an implementation of the ActiveRecord pattern for .NET. The ActiveRecord pattern consists on instance properties representing a record in the database, instance methods acting on that specific record and static methods acting on all records.
Castle ActiveRecord is built on top of NHibernate, but its attribute-based mapping free the developer of writing XML for database-to-object mapping, which is needed when using NHibernate directly.
SubSonic
The first public DAL which employed Build Providers that I know off :)
Summary
A Data Access Layer (DAL) builder that requires no code on your part, it builds itself at compile-time with a full object layer and strongly-typed Collections
A complete utility toolset, complete with Rails-like scaffolding, migrations (DB Versioning), and code generators
A dynamic query tool, that lets you use SQL Server and the Enterprise Library without having to know SQL
An OR Mapper that extends to views and stored procedures so you're not locked into the OR/M thing
The syntax / setup by ORM:
Setup dOOdads:
Install MyGeneration code generator Create stored procedures ( optrional ), Create DAL.
Copy files to current project folder.
Copy DLL and your done.
Setting the connectionstring can be done in the appsettings: "dbconnection" is it's default.
Setup Active Record:
Generate Classes using Active Record Generator (Sql Server only), or through several other methods. Generating the classes is pretty wrist friendly.
Just setting property's for every column and defining it's relationship is enough. b
It also needs a section in the web.config or a bit of code to set it up and a couple of DLL's
Setup SubSonic:
Classes can be generated by using a build provider, which means as much as have let VS.Net create the classes at build time which means you don't have to manually have to update the classes. ( Needs full trust )
Classes can also be generated trough the supplied templates which are called through a web interface.
It also needs a section in the web.config or a bit of code to set it up and a single DLL.
Setup Conclusion:
All have different approaches with none of them actually having a leg up on the others at least not for me.
They can all be set up within 10 - 20 minutes and are thus also usable for small projects.
-----
The Code for some standard actions:
In this table the code for the active record solutions is missing this is because I couldn't really find any documentation in a downloadable form for this framework on how to do these things. (which doesn't mean that it's not out there :)
| dOOdads |
Active Record |
SubSonic |
|
Retrieving all records of a table |
Dim emps As New Employees emps.LoadAll |
|
Employees.FetchAll(); or sorted: GridView1.DataSource = Employees.FetchAll(SubSonic.OrderBy.Asc(Employees.Columns.LastName)); or in a collection: EmployeesCollection products = new ProductCollection(); Employees.OrderByAsc(Employees.Columns.LastName); Employees.Load();
|
| Retrieving a single record |
Dim emps As New Employees emps.LoadByPrimaryKey(EmpID) |
|
Employees employees = new Employees(id); or: Employees employees = Employees.FetchByID(id); or: Employees employees = new Product(Product.Columns.LastName, "Chai");
|
| Adding a record |
| Dim emps As New Employees
emps.AddNew() emps.LastName = "Smith" emps.HireDate = Now emps.Save()
'return new key value EmpID = emps.ID |
|
Dim emps As New Employees
emps.LastName = "Smith" emps.HireDate = Now emps.Save()
'return new key value EmpID = emps.EM_ID
|
| Editing a record |
|
Dim emps As New Employees
emps.LoadByPrimaryKey(EmpID) emps.LastName = "Smith" emps.HireDate = Now emps.Save()
|
|
Dim emps As New Employees (key value)
emps.LastName = "Smith" emps.HireDate = Now emps.Save()
|
| Deleting a record |
|
Dim emps As New Employees
emps.LoadByPrimaryKey(EmpID) emps.MarkAsDeleted() emps.Save()
|
|
Employees.Destroy(key value) |
| More complex query: select top 10 firstname, lastname from employees where salary > 1000 order by lastname asc |
|
Dim emps As New Employees
With emps
.Query.Top = 10 .Query.AddResultColumn(.ColumnNames.firstname) .Query.AddResultColumn(.ColumnNames.lastname) .Where.salary.Value = "1000" .Where.salary.Operator = WhereParameter.Operand.GreaterThan .Query.AddOrderBy(.ColumnNames.lastname, WhereParameter.Dir.DESC)
End With
emps.Load() GridView1.DataSource = emps.defaultview
|
|
dim q as New SubSonic.Query(Employees.TableName)
q.top = "10" q.SelectList = Employees.Columns.firstname + ", " + Employees.Columns.lastname q.AddWhere(employees.Columns.salary, SubSonic.Comparison.GreaterThan, 1000); q.OrderBy = SubSonic.OrderBy.Asc(Employees.Columns.lastname)
GridView1.DataSource = q.ExecuteReader()
|
Strengths / Weaknesses:
dOOdads
The good:
- has been around for a while
- has support for a large amount of databases
- has super easy aliassing built into it through the user of MyGeneration
- source in C# and VB.Net
- simplest framework of the lot (even I understood some of it :P)
- active support forum
- has a silly name :)
The bad:
- no active development at this time
- no templates support for dynamic SQL from MyGeneration itself
Subsonic
The good:
- least amount of code to do stuff
- build providers can mean: almost zero todo to get it working
- very rapid development of the framework
- free helpers:
- auditing (created by, created on, modified by, modified when)
- scaffolding (control using subsonic)
- html report of tables
- it feels "smart"
The bad:
- it hasn't been around for very long
- very rapid development of the framework
- bombs on database tables with spaces in them amongst other things.
Castle Active Record
The good:
- it's built around the NHibernate engine
- it has support for the Hibernate query language
- it has a built in validation framework
- tables can be created from the classes
- it has support for joins
The bad:
- it's built around the NHibernate engine
- it's a probably a lot more complex then the other 2
Conclusion
I myself have used dOOdads with a number of projects and was very pleased with it's performance and it's easy of use and speed to set up.
For another project I used SubSonic and I was even more pleased with it's syntax + being able to use asp.net pages to generate te classes was a big plus for me.
Allthough it's possible to generate dOOdads classes through the command line I never got that far into MyGeneration to pull that off.
For me I'll be going for SubSonic for my future projects.
With dOOdads as a backup ORM.
PS. If anyone has a very easy to set up ORM which he / she thinks is better then the ones in this comparison please let me know :)