Tech Tock

Time is of the essence.

Linq to SQL – Not Dead Yet?

Is Linq to SQL Dead?  Microsoft says no in this cute Visual Studio Features vs. imageMyths applet.

Damien Guard (MS L2S/EF team member), on the other hand, tells how the framework will die slowly:

We said we would improve the core of it and add customer requests where it makes sense but that Entity Framework would be the primary focus.

If you heard otherwise it certainly wasn’t from this team.

Seems to be on life support, with the family just arguing if the tax situation is right to pull the plug this year or next.

Read all about the bug fixes, ahem, new features in L2S in .Net 4.0 here.

I wouldn’t mind its demise as long as something so simple and easy exists in EF when it goes.  I’m thrilled the ThreadPool is Dead and I hope I can be just as excited when Linq2SQL finally kicks.

September 18, 2010 Posted by | Uncategorized | | 2 Comments

A Free Database You’ll Hate (At First?)

I’m doing a small project that could use some local caching persistence, so I picked my old buddy SQL Server.  SQL Server Compact Edition (SSCE, CE) to be precise.

I’m finding it to be SQL Server with all the fun removed.  At least it supports multiple database connections.  But there’s no database diagrams, you can’t make a PK clustered, and Linq2SQL refuses to make a diagram in Visual studio among other indignities.

You can’t even generate scripts from a Compact DB schema :(.  An MVP recommended this commercial utility (what, pay for a utility?) and the guy with all the points on StackOverflow got it wrong, Management Studio won’t let you generate a script for a Compact DB.  But the answer is down in the list of responses (the first time I saw a correct answer ignored on StackOverflow).  This CodePlex tool does a good job of scripting the database.  Its a convenient Management Studio plug-in.

Strange thing that the same MVP recommends the same company for making database diagrams in SSCE. My Spidey Sense is tingling.

Since the project is so small and the database part is so trivial, I can justify Linq2SQL even though its on its way out, but try to drag a table into a Linq2SQL dbml designer and Visual Studio complains:

image

Since my project only needs a couple quick and dirty tables and SQL Server any version is acceptable to the client, I’m going to forge ahead.

Since Visual Studio UI won’t create a Linq2SQL dbml for a SQLCE database, this blog, pointed me to SQLMetal.exe, which is included with Visual Studio 2008.  Why Visual Studio should be so picky is beyond me.

On the other hand I could use a typed dataset, which I’ve found brittle in the past and hardly as user friendly as Linq2SQL.  This is created automatically when you create a CE file database in Visual Studio.  No thanks.

the SQLMetal worked on the first try, so alls well that ends well.  Its easy to keep the command window open and just delete the dbml and rerun the SQLMetal command anytime you update the schema.

Once it was all setup I was back in Linq Heaven.

So, it seems the moral of this story is that with the right collection of utilities, SQL Server Compact Edition is a workable persistence store for a small application.

December 3, 2009 Posted by | Uncategorized | , , , , , , , , | Leave a comment

@Lab This Week 11/27

Just Test – Nuff Said? Nah.

Big discussion about unit testing.  Views ranged from 100% coverage is necessary, to some code is not worth the trouble.  The 100% camp was hit with this rebuttal:

How is the coverage measured?
Is it just checking which code blocks ran during the test?
What about covering different code paths?

Everyone was in favor and there were some interesting insights including an example of “correctness by construction” in Haskell:

…”correctness by construction” (aka “making illegal states unrepresentable”).  This approach relies on a rich type-system (and, at a deeper level, an interesting fact technically known as the “Curry-Howard isomorphism”).  Ideally, when this can be achieved you can completely discharge the need for a lot of unit tests (replacing sort of probabilistic certainty with actual certainty).

Plenty of good links were sent and summarized:

This study found bug reductions of 40-90% with 15-25% coding time added.

Some recommend testability above clarity.

Guidelines on proper coding for testability (in Java).

Miscellany

I heard some talk about an A team being formed to take on a project. I’d like to see the problem these guys can’t solve.

Check out this interesting tool for translating a data model into a class model with proper naming and casing using either Entity Framework or Linq2SQL.

All in all, a quiet week as expected.

November 27, 2009 Posted by | Uncategorized | , , , , , , , | Leave a comment

.Net Meetup – FX Fun

Went to the .Net Meetup Tuesday night and had a great time.  Plenty of interesting discussion and some laughs too. (All that and free pizza too). Highly recommended:

        if (yourGeekiness >= myGeekiness)

Daniel Chait (my boss 🙂 led the meeting.  The below info is mostly from Dan’s notes which he wrote on the overhead in real-time (I take credit for any errors or omissions).  As you can see, if you didn’t attend, you missed a lot.  These are mostly just the topics.  Each one generated lively discussion:

PDC 2009 started today:

Microsoft CodeName “Dallas” announced.

Microsoft “Micro Framework” open sourced:

(not including some stuff like Crypto etc)

Scott Hanselman had a podcast about it?

Azure going live in February (cloud services)

Business Model announced.

Cloud Computing : Compare Azure vs others

Vs Amazon EC2?  Amazon gives you a virtual machine, whereas Microsoft gives you specific services (i.e. web, database, WCF services).  Also cloud-based Pub/Sub model.

BizSpark!!!

– For co’s & individuals

–Co less than 3 yrs. old, less than $1MM, private

– You get all Microsoft stuff basically for 3 yrs. free.

– Check out the “Program Guide” off the website for more details

WebSpark?

– You get VS, SQL Server, and Blend, etc. to get started

– 3 year license for free

PowerPivot

– Part of Office 2010 (was codename “Gemini”)

WPF Grid Controls?

– Using DevExpress (WinForms grid)

– Infragistics – not much new there. tech support pretty good.  glaring bugs in new versions.  difficult upgrading between different versions due to problems with style upgrades

– WPF Toolkit has a grid control: very basic, missing a lot of features (i.e. Filtering etc)

– XCeed well regarded. Been around the longest, full featured.  Cons: tech support iffy.  Licensing may be problematic – issues when you convert from demo to licensed version.

Data Direct products:

– XML converters

– Database connectors

– Difficult licenses

.NET Framework v4?

– Tasks, parallel stuff – http://en.wikipedia.org/wiki/Parallel_Extensions

– WorkFlow changing a lot in V4 as well

– Documentation is very minimal at this point

– Maybe some good PDC content coming out?  i.e.
http://microsoftpdc.com/Sessions/P09-22

– Maybe some channel9 stuff to find?
Hello Workflow 4

WF4.0 A First Look
More

What do people actually use WF for?

– Sharepoint development.  Basic stuff.

Architecture in .NET Question: Model Approach to Database Access?

– ORM Software: Developers make clean code which makes horrible queries

– Call Stored Procs from software: nice queries but ugly to call

Entity Spaces

– Experience: Easy to use, decent performance but on a simple app

– In ALL cases, need to analyze queries in detail, can’t just rely on the ORM to sort it out

– Microsoft Entity Framework 1.0 – not full featured enough

– New one coming out

Linq2SQL is dead 😦

– Linq2SQL used a GUID(?) which killed query caching

– NHibernate – “granddaddy of them”.

– Cons : “Has a case of the Java’s”.  XML Configuration, FactoryFactoryFactory…, etc.

GRAND CLAIM: Try to avoid open source:

– Hmm…

– IF something is just a small, weekend project on CodePlex, probably worth avoiding.  But, like, …

– NUnit

NHibernate

– NCover

– NMock, moq, RhinoMock

– Log4Net, nlog

– log better, easier to configure

– Fluent NHibernate

– The MONO project

– Need to treat it more like “code” than a “product” from a vendor.  Actually understand the code don’t just consume it.

– Open source projects are driven by enthusiasm

– JQuery plugins for example

One user mono in production spoke up.

– Follows the Pareto Principle – for example doesn’t use code signing

– Implementing silverlight (i.e. Moonlight) which works on the iPhone

– Castle project – ActiveRecord implementation – says it’s at least as good as say RoR – just does property setting in code, built on top of NHibernate, scaffolding, etc.

The Munawar principle – 20% will be good, 80% will be garbage

FBK #2: Sturgeon’s Law – “90% of everything is crap”

NCover – code coverage tool

“Where’s my LINQ2 Mainframe?”

SubSonic – open source framework for stuff – http://www.subsonicproject.com/

– “A Super High-fidelity Batman Utility Belt that works up your Data Access (using Linq in 3.0), throws in some much-needed utility functions, and generally speeds along your dev cycle.”

[long discourse about non programmers.  in short, they are inconvenient.]

AJAX / ASP.NET – still buying into it?  As opposed to WPF / Silverlight / Flex?

– Corollary – as a novice, what should I be getting in to

– Corollary 2 – if I want to get out of ASP.NET and get into WPF and realtime .NET desktop apps, how do I do it?

– Endless debate about Silverlight vs Flex

– Silverlight can be applied-ish to WPF knowledge

– Flex VERY easy to learn

Silverlight vs WPF?

– Third party controls maybe a bit better in WPF at present

– If heavy desktop integration, use WPF, else Silverlight by default

– Silverlight Out of Browser – still in the sandbox but just looks like the browser is missing.

– Databinding in Silverlight not nearly as good as WPF.  A bit better in 3.0 but still not great

[spontaneous demo of Castle ActiveRecord]

Good localization solution?  Want to translate our site into multiple languages….

– Sharepoint can do some of this but not ALL languages

– New version of Sharepoint (2008?) does this

– Beware of language specifics (i.e. German has long words)

– Maybe any content management solutions that exist?

– How to handle caching?

– Generate static content or regenerate on the fly every time?

– See http://latino.msn.com/ for more

http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx

November 19, 2009 Posted by | Uncategorized | , , , , , , , , , , , , , , , | Leave a comment

In Memory of Linq2SQL – 2006 – 2008 – RIP

I was doing a lot of Linq2SQL recently and it was easy and convenient – I’d highly recommend it. Except for the fact that its now obsolete. Linq2SQL is being tossed aside in favor of Entity Framework, which is not as lightweight or simple :(. I would look into NHibernate from what I’ve read of Entity Framework.

In another version or two Entity Framework may get more of Linq2SQL’s simplicity and ease of use. Oh joy.

November 16, 2009 Posted by | Uncategorized | , , , , , | 4 Comments