Article In .Net Developers Journal
| I wrote an article for the current issue of .Net Developers Journal, its about getting started using MySql in a .Net environment, take a look and let me know what you think. |
| I wrote an article for the current issue of .Net Developers Journal, its about getting started using MySql in a .Net environment, take a look and let me know what you think. |
When people think about OR mappers, they usually think about code
generation and automating the CRUD operations in an object oriented
fashion. At my previous job, we rolled our own OR mapping
framework because we (1) didn’t know what OR mapping was (2) didn’t
realize that many other products exist that do the same thing but
without developing it yourself :-).
One feature that we incorporated into our framework was the notion
of copying an entity in the database. At a simple level this
would take an entity, Customer, and copy its values into a new row and
returning the newly created entity.
Customer c2 = c.Copy();
Now, this functionality by itself is pretty useful, and pretty easy
to implement. Basically all you are doing is reinserting the
current entity in the datastore, loading up the new entity and
returning it. This saves you a few lines of code by having the
.Copy method. Where the benefits really start to show themselves
is when you want to copy an entity that has relationships with other
entities and you need those other entities copied as well.
Consider a scenario where you have a calendar application that
has activities. Each activity in turn has potentially many
contacts associated with it. You can override the .Copy method in
your ActivityEntity object to look something like this:
[AirCode]
public ActivityEntity Copy()
{
ActivityEntity copiedEntity = base.Copy();
foreach(ActivityContactEntity item in this.Contacts)
{
ActivityContactEntity copiedContact = item.Copy();
copiedContact.Activity = copiedEntity;
copiedContact.Save();
}
return copiedEntity;
}
Now when you copy an activity, all the contacts get copied as
well. All that has to happen after copying a contact is to
associate the contact with the new activity rather than the original
one. This example is pretty simple with only one set of related
entities. In practive I’ve used this functionality to copy
entities that had about ten related entities, some as a collection
like in this example, and some 1 – 1 relationships. Having this
easy ability to copy entities can really add a lot of rich features to
your applications, like copy and paste, undo and redo, stuff like that
becomes much easier when you can copy an entire object regardless
of its data complexity. This is a feature that I’m going to be
working on adding to Codus for a future release, among other things, and I’m excited to be working on it, its a rather interesting and fun exercise.
Adapdev has released Codus v1.2
today. Codus is a code generation application that generates
database entities that utilize the Adapdev O/R framework. The GUI
for Codus has gotten some great upgrades and MySql support was added,
among other things. Sean let me help out on the MySql
implementation, after I started working on it on my own so that I could
use Codus for my applications that use MySql. I did my testing
using MySql 4.1.x and we use the MySql .Net connector for the database communication.
I did most of my work a few months ago, and then I fell off the map
with the new job and the wedding, I’m trying to get back into helping
out however. Congrats to Sean for getting the next release of a
great product out.
It has taken all the willpower I have to not order this Skype phone.
This phone is effin’ awesome, its made by LinkSys who worked with Skype
to develop it. There is a great review of the phone at the VOIP blog.
My buddy Mike bought a Skype phone that he uses when hes at home and
has been very happy with it. I would love to have a cordless
Skype phone at home to replace the crappy cell reception that I get in
my home, plus talking on a cell phone sucks. The phone is small
and the face of it gets all hot after you talk for 5 minutes, I much
prefer talking on a real sized phone.
I’m looking forward to the day when cities are allowed to have WiMax
installed city-wide. I think when that happens we will see Skype
cell phones becoming extremely popular. If people think that
Skype is a disruptive technology now, wait till regular cell phones
start getting trumped by Skype phones that people can use anywhere, not
just at home. As more people adopt Skype the cost will only go
down from its already-super-cheap price of ~$.02 a minute worldwide to any landline or cell phone and free
to call to other Skype users. The one thing that I do worry about
with Ebay’s purchase of Skype is that Skype users will have to start
listening to a 30 second commercial before they can place a call or
something, I hope that doesn’t happen, I’m keeping my fingers crossed.
The reason I can’t pull the trigger on the phone now is that Erin
and I have plenty of other things to spend $100 on. Its now
become the first item on my Christmas list, although when I asked
Erin for a wireless keyboard and mouse two years ago, I was scolded for
asking for such a “dumb, geeky” gift, some things just don’t change
This should be in “New of the Weird” or something, kind of brings up a funny image in my head!
I don’t think I’ve ever seen someone who really hates unit testing like Wil Shipley (via Coding Horror).
He brings up some really good points too, by the end of it I wanted
to go and delete all of my unit tests too! Like Jeff Atwood, I
think that unit testing is a good first line of defense for the
developers to use, but the important stuff is getting actual users to
use your product extensively in a variety of environments.
Since Erin and I moved into our new house,
we’ve had some little projects to do here and there. The house is
also about 80 years old, so there will certainly be more to do in the
next year or two. To help us out while we do these projects, Erin
signed us up for a 2 year subscription to Angies List (www.angieslist.com).
This is a web site where people can write about their experiences
in home improvement and rate vendors, give prices, etc. The 2
year subscription was something like $75, so I kind of freaked out at
first, but then she reminded me that I pay $25 a year for my Flickr subscription and about the same for some domain names, so its hard to argue with the logic there
Anyways, on to the point of this post. So when I went to
angieslist.com, the site looks very cleanly designed, and there are no
ads (which is why the subscription is what it is). Now, for some
reason you can just tell when a website has an XHTML doctype, and this
was one of them. So I viewed the html source to confirm what I
thought, and I was right, the site uses xhtml transitional. For
some reason when I see that a website has an xhtml doctype, their
credibility with me goes through the roof. I don’t know if its
the inner geek that just likes xhtml, but you know that if they went
and found a development shop that does standards based development, it
was probably a pretty good place that cost a decent amount of
money, and it shows that the people are running a legitimate
business. So in the face of Erin’s logic and the standards based
website, I’m cool with the 2 year subscription
Well, it finally happened. Bloglines
has made some product updates that I’ve noticed tonight. They
changed the browser title to include the number of unread items in it a
la GMail, the number of unread items is actually 2 numbers: one is the
number of unread items, and the other number is the number of items
that the user has “saved” for later viewing. The 2 numbers are
separated by a colon.
They’ve also added some cool navigation features in the reading
frame. You can use the ‘j’ key to scroll to the next item and the
‘k’ key to go to the previous item. There are also hotkeys to
move to the next subscription, the next folder, to refresh the left
pane, and mark all as read.
I love these changes, especially the unread count in the browser title
bar, cause now I can just leave it open in a tab of firefox and know
whether or not I have unread items in there, I’ve been using the greasemonkey script that Alex Bosworth wrote to do just this. The hotkeys for navigation I first saw in the feed lounge
alpha, so I wonder if thats where the idea came from. Bloglines
development isn’t really talked about too much, they definitely aren’t
as transparent, (or prevalent I suppose) as other software vendors like
Microsoft. Its nice to see them making some upgrades.
Our local newspaper here, the Star-Tribune,
just rolled out their new website design. Interestingly, the site
appears to be opitmized for Firefox, as the top navigation buttons have
drop down menus that appear in Firefox, but not it IE. The
doctype they use is HTML 4.01 Strict, and using my Html Tidy firefox
extension, it appears that their html is rather clean. As I said, they
just rolled the site out this morning, and the site was actually down
for a few hours it seemed (at least for me, not sure what my deal is
lately). Also, if you move your mouse over the top navigation
buttons in Firefox, you can see three advertisement windows flash on
the screen quickly, if you move your mouse quickly over the buttons,
you can see who the ad is for :-) The flashing ad thing is
definitely a javascript bug, I’m not sure where those ads are supposed
to show up, but its rather annoying right now.
Well, I don’t know if GMail is down for anyone else, but I haven’t been
able to log on since last evening, this is certainly the longest that
I’ve ever seen GMail been down for, and I was also playing around with
Google’s feed reader, and that started to flake out on me too, makes a
guy wonder if they’re having some issues lately………..