So lets talk about the relevant Fluent Nhibernate features:
- Schema("viplookups.dbo");
The first item of interest is the Schema() method. The schema function tells NHibernate to pull this entity from a specified database. In my case this database exists on the same SQL Server. So I didn't need to try it on another server. If you have knowledge of this working on another server leave a comment here.
- Table("bnkroute");
The next item of interest is the Table() method. This is pretty straight forward Fluent NHibernate and specifies the legacy table to pull your data from.
- SchemaAction.None();
The next interesting feature is SchemaAction.None(). When developing our applications I have an integration test that is used to build all our default schema. I DONT want these table to be generated in our schema, they are external. SchemaAction.None() tells NHibernate not to create this entity in the database.
So that's it. A simple combination of Fluent NHibernate features to access data from a legacy database properly.
My name is James Bigler. I am a software developer. This blog is mostly a collection of links related to software programming and technology.
Search This Blog
Wednesday, June 30, 2010
Using Fluent NHibernate With Legacy Databases
Monday, June 28, 2010
Friday, June 25, 2010
Test-Driven Javascript
Test-Driven JavaScript
In this talk my goal was to demonstrate as real as possible what it would be like to Test Drive your JavaScript Development, and to help you see that there really isn’t any reason why not to develop in this manner. And because of that I did not rehearse the actual coding exercise till perfection. I mean I know it was possible to do what I wanted, but I wanted to show the whole thinking about what to do as well, not just paste in pieces of code. Because that would not have been anywhere close to actual development. So needless to say I ran in a few small issues, but thankfully nothing that I couldn’t solve and if anything this was as real as it gets. So I am happy with this one. You can see the Test-Driven JavaScript recording here and also all the other recordings from NDC2010 here (well they will be there shortly, amazing how many they already made available).
How do I get started?
So after you have seen the recording and gotten all excited about Test Driving your JavaScript Development but you don’t really know where to go from here. Here is a small list of recourses and stuff that have helped me.
- All the original code for my website (which my demo was based upon) can be found on my GitHub account. This includes the JSpec specs as well as the Cucumber specs. The JSpec specs are in /public/jspec/unit/ where the page (Dom.html) that executes it is located one level higher. The JavaScript file under test is in /public/javascripts/ and the page containing it all is /public/index.htm.
- My actual website, so you can see the results, and also the JSpec specs and the JSLint output.
- JSpec is the JavaScript testing framework of my choice
- The slightly adjusted Dom.html page that includes a timer to facilitate the continuous testing.
- My own addition to better deal with animations, as the JSpec library doesn’t really threat these correctly.
- JSLint is a cool tool to get rid of smaller syntax errors and check the code quality.
- My JSLint execution page, not very special, but hey here it is.
Questions?
If you have any questions, then please let me know, I am more then happy to help where I can.
StoryQ
StoryQ is a portable (single dll), embedded BDD framework for .NET 3.5. It runs within your existing test runner and helps produce human-friendly test output (html or text). StoryQ's fluent interface adds strong typing, intellisense and documentation to your BDD grammar.
Bulk processing with NHibernate
On a recent project, much of the application integration is done through bulk, batch processing. Lots of FTP shuffling, moving files around, and processing large CSV or XML files. Everything worked great with our normal NHibernate usage, until recently when we had to process historical transactional data.
The basic problem is that we had to calculate historical customer order totals. Normally, this would be rather easy to do with a SQL-level bulk update. However, in our case, we had to process the items one-by-one, as each transaction could potentially trigger an event, “reward earned”. And naturally, the rules for this trigger are much too complex to attempt to do in straight T-SQL.
This meant that we still had to run our historical feed through the domain model.
Monday, June 21, 2010
Using FxCop: A Short Tutorial
An in-depth tutorial on customizing Microsoft FxCop.
Wednesday, June 16, 2010
SourceForge.net: Project Statistics for NHibernate
Get NHibernate at SourceForge.net. Fast, secure and free downloads from the largest Open Source applications and software directory. .NET port of the excellent Java Hibernate which provides Object/Relational mapping to persist objects in a relational database.
Tuesday, June 15, 2010
Domain Language /Model Exploration Process
Eric Evans: Folding Design into an Agile Process
The talk "Folding Design into an Agile Process" was originally given by Eric Evans at QCon London 2010. We recorded it at a meeting of DDD-NYC SIG in May of 2010, shortly after the conference.This talk was originally presented by Eric Evans at QCon London 2010. The recording is made during a meetup of DDD-NYC SIG in May of 2010.
Abstract
After a decade of heavy process, the Agile revolution of the late '90s threw off the dead hand of big upfront design. The bloody purge that followed was needed!
Click here to view Flash content.
Friday, June 11, 2010
Readability - An Arc90 Lab Experiment
Readability is a simple tool that makes reading on the Web more enjoyable by removing the clutter around what you're reading.
Tuesday, June 8, 2010
Finger on nose: how to make fast decisions « Scott Berkun
There is an old adage in leadership circles: sometimes it doesn't matter what you decide, as long as you decide quickly and take action. Standing in front of an
Thursday, June 3, 2010
Rietveld, or “How to revamp your code review process”
For me, code reviews have traditionally been one of those aspects of software development that fall into the “good idea; bad execution” category. It’s something that I know we’re supposed to do but when someone says, “let’s do a code review”, my first reaction is usually to make a cross with my fingers and start yelling “THE POWER OF CHRIST COMPELS YOU!” at them.
YouTube - RSA Animate - Drive: The surprising truth about what motivates us
Wednesday, June 2, 2010
C#5 and Meta-Programming
We've been extremely busy the last months in order to have a well polished release of NDepend v3 completely integrated in VS 2010, 2008 and 2005.Now, having NDepend as a companion in all my VS instances makes each of my programming day bright . But it is already time to think about what's next. We have tons of plans and you are welcome to publish all your secret wishes for NDepend vNext in the comment of this post.