Gemli Project v0.2 Released

by Jon Davis 21. September 2009 03:57

Earlier this late night I posted the first major overhaul update of Gemli since a month ago. This brings a huge number of design fixes and new features to Gemli.Data and makes it even more usable. It's still alpha, though, as there's a lot more testing to be done, not to mention still some new features to be added.

http://gemli.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33281

From the release notes:

  • Added to DataProviderBase: SupportsTransactions { get; } , BeginTransaction(), and BeginTransaction(IsolationLevel)
  • Facilitate an application default provider: Gemli.Data.Providers.ProviderDefaults.AppProvider = myDBProvider .. This allows DataModels and DataModelCollections to automatically use the application's data provider when one hasn't already been associated with the model (so you can, for example, invoke .Save() on a new model without setting its provider manually)
  • Replace (and drop) TypeConvertor with DbTypeConverter.
  • Operator overloads on DataModelQuery; you can now use == instead of IsEqualTo(), but this comes at the cost of chainability. (IsEqualTo() is still there, and still supports chaining.)
  • Added SqlDbType attribute property support. DataType attribute value is no longer a DbType and is instead a System.Type. The properties DbType and SqlDbType have been added, and setting any of these three properties will automatically translate and populate the other two.
  • DataType attribute value is no longer a DbType and is instead a System.Type. The properties DbType and SqlDbType have been added, and setting any of these three properties will automatically translate and populate the other two.
  • WhereMappedColumn is now WhereColumn
  • Facilitate optional behavior of inferring from all properties not marked as ignore, rather than the behavior or inferring from none of the unattributed properties unless no properties are attributed. The latter behavior--the old behavior--currently remains the default. The new behavior can be applied with DataModelTableMappingAttribute's PropertyLoadBehavior property
    • This may change to where the default is InferProperties.NotIgnored (the new behavior), still pondering on this.
  • Add sorting to MemoryDataProvider
  • TempMappingTable is now DataModelMap.RuntimeMappingTable
  • ForeignDataModel.ForeignXXXX was backwards and is now RelatedXXXX (multiple members)
  • DataModelFieldMappingAttribute is now DataModelColumnAttribute.
  • DataModelMap.FieldMappings is now DataModelMap.ColumnMappings.
  • DataModelTableMappingAttribute is now DataModelTableAttribute.
  • DataModelForeignKeyAttribute is now ForeignKeyAttribute.
  • The XML serialization of all elements now follows these renamings and is also now camelCased instead of ProperCase.
  • XML loading of mapping configuration is getting close, if it isn't already there. Need to test.
  • Added DataModelMap.LoadMappings(filePath)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

C# | Cool Tools | Pet Projects | Software Development

Is The Microsoft Stack Really More Expensive?

by Jon Davis 5. September 2009 23:17

As a Microsoft customer, who at times rambles on with a fair share of complaints about Microsoft’s doings, I want to take a moment to discuss Microsoft’s successes in making its development stack affordable, equal to or even more so I’d argue than the LAMP + Adobe stacks.

Let’s Get Started

If you’re developing for the web, Microsoft makes it easy to download everything you need to develop on the Microsoft stack for free with a do-it-all download application called the Microsoft Web Platform. Everything you need to get started is available from that tool for free, including (but not limited to):

  • Visual Web Developer 2008 Express (FREE)
  • Silverlight tools for Visual Web Developer (FREE)
  • Microsoft SQL Server 2008 Express (FREE)
  • IIS extensions such as FastCGI for running PHP applications (FREE)
  • ASP.NET add-on libraries, including ASP.NET MVC (FREE)
  • Tons of free, open source ASP.NET applications (FREE)
  • Tons of free, open source PHP applications that can run on IIS (on Windows) (FREE)

I’ll even go so far as to repost a pretty Microsoft-provided button.

(FREE)

Windows

Let’s get the obvious realities of Microsoft stack expenses out of the way first. Microsoft is a platforms company. They make their money off of our dependence upon their platform. That platform is Windows. Many people’s reaction to this is to hold up two fingers to make a cross and shout, “Eww, nooo! No! Monopolies, baaad!” I believe I have a more well-rounded response, which is, “Oh! Well dang. If we’re going to build up a dependency upon a platform, that platform (and its sub-platforms) had better be REALLY FREAKING GOOD—good as in performant, easy to work with, reliable, scalable, and a joy to use, and it had better support all the things most all the other platforms support.”

Enter Windows Server 2008 and Windows 7.

Over the last decade, Microsoft has worked hard to achieve, and since Windows Vista (believe it or not) has already achieved, the right to sing the song to Linux,

Anything you can do,
I can do better!
I can do anything
better than you!

 

And yeah I think Microsoft gets the girl’s part on this one, but perhaps only because of:

Boy: I can live on bread and cheese.

Girl: And only on that?

Boy: Yup.

Girl: So can a rat.

By this I simply mean that everything that’s on the Linux stack is also on the Windows stack, plus Microsoft has its own proprietary equivalents that, in the opinions of most of its customers, are a lot better than the open source equivalents. Take PHP for example. Internet Information Server 7 does everything Apache can do plus host non-HTTP network applications, but it also does everything Apache does, functionally speaking, including configuration details and hosting PHP. But it also performs faster than Apache at hosting PHP applications with Fast-CGI and binary script caching installed and enabled. But beyond PHP, which in itself is technically not much more than ASP Classic (Javascript flavor), Microsoft’s ASP.NET is far more powerful and versatile than PHP, and it’s 100% free (after the cost of Windows itself). And don’t get me started about how much better I think Windows is at GUIs and graphics with GDI+, DirectX, and WPF, than the Linux flavors. (Apple, on the other hand, competes pretty well.)

Windows can also execute all the Java and Ruby stuff that you see in *nix platforms. In fact, Windows has all the UNIX subsystem underpinnings to make a UNIX enthusiast comfortable. The shell and all that fluff is a separate download but it’s all part of the Windows package and is free after the full Windows Ultimate or Windows Server license. You can snag Cygwin, too, if you like, if you want to get an even richer Linux-like experience.

So that’s Windows; you can go fully-licensed and get Windows 7 Ultimate ($219) + Windows Server 2008 R2 ($999) as a workstation + server combo for a total of $1,218 plus tax. However, if you’re in a position to care about that much money, I can tell you that you do not have to suffer that amount if you don’t want to.

First of all, Windows 7 Ultimate can perform just fine as a server. Windows Server 2008 is intended more for an enterprise environment that requires prison-like security and needs some very enterprisey or advanced features, such as hosting Active Directory domains, hosting Exchange Server, or hosting some unusual network services for developers with very specialized needs. If all your needs can be met with IIS and a database, so long as you don’t have a million hits a month (there is, unfortunately, simultaneous network connection count throttling built into Vista/7), you really don’t need anything more than Windows 7 Ultimate, no matter how many sites you host. It will scale, too, and in fact Windows 7 is built to handle tens of CPU cores. So, going Windows 7 only takes the total cost down to $219.

Second, if you really do want to go with the Server flavor, you have a couple more options, including a COMPLETELY FREE option which is very easily accessible, but I’ll get back to that later.

I just want to say, though, at this point, that I for one am already a Windows user, and you probably are too, statistically speaking. Our investments have already been made; however, only the Ultimate edition of Windows is one I would settle for as a “Microsoft stack” developer. Mind you, I’ve never had to pay the full price for any version of Windows in many, many years, yet I am currently running the latest and greatest. Again, I’ll get into that later.

Now let’s look at the development languages and the tools that support them.

Development Languages and Tools

The big names among the non-Microsoft platforms for languages and sub-platforms are:

  • PHP,
  • Ruby (on Rails),
  • Python, and
  • Java

Their tools come in many shapes and sizes. They can be as simple as vi or as complex as NetBeans. Many of the good tools people like to use are free. However, many of them are not.

For example, Aptana Studio is a very good web development IDE that supports Ruby, PHP, and Aptana’s own Javascript/AJAX platform called Jaxer, plus it runs in Eclipse so it supports Java as well. But the Pro version costs $99. That’s not free. There’s also JetBrains RubyMine which is also $99. On the other hand, Ruby developers tend to adore NetBeans, particularly over Aptana, and that is free. So go figure, to each his own.

The point is, if you want to get a rich and richly supported toolset, you’re just as likely going to have to pay for it in the non-Microsoft stacks.

On the Microsoft stack side, everyone knows about Visual Studio. The licensing cost for the Team Suite is $10,939. LAMP developers just love to point that kind of thing out. But folks, the fact is, that price is not measurable as the equivalent of LAMP freeware. It’s for an enterprise shop that needs very advanced and sophisticated tools for performing every corporate software role in a software development lifecycle. If you’re measuring the price here and it’s of concern to you, you probably don’t need to choose the most expensive offering to evaluate the costs of the MS stack!

First of all, the Professional edition of Visual Studio, if you’re crazy enough to have to pay for that out-of-pocket (i.e. not have your employer pay for it or get it in a bundled package such as one of the free ones) only costs $799, not $10,939.

Secondly, if money matters all that much to you, and you’re unable to get one of the free or nearly-free bundles (more on this in a bit), you really should push the limits of Visual Studio Express first. It’s free.

Experience Development Tools: Microsoft Expression vs. Adobe CS

Microsoft has been competing with what was Macromedia, now Adobe, for its designer-oriented web tools for a very long time, and finally came through with a reasonable offering with Expression Studio a few years back, which offers very close to the same functionality, at least at a basic level, for creating compelling web experiences as Adobe’s current CS4 Web Premium offering minus Photoshop.

Dreamweaver vs. Expression Web

A surprisingly large number of web designers use Adobe Dreamweaver (formerly Macromedia Dreamweaver) as their standard web creation tool, not far in similarity to the ubiquity of Adobe Photoshop for editing graphics. Microsoft has had an equivalent web creation tool for well over a decade. It used to be called FrontPage, now it is called Expression Web. But let’s get one thing clear: Expression Web replaces FrontPage, it is not a rename of FrontPage. It is, in fact, a different product that accomplishes the same task and in the same general way. By that I mean, as far as I know, very little of Expression Web’s codebase reuses FrontPage’s legacy codebase; it is a total rewrite and overhaul of both the tools and the rendering engine.

Expression Web supports PHP, in addition to its extensive support for ASP.NET and standards-based raw HTML and CSS. Technically, Expression Web is very close to being on par with Dreamweaver, and I think the differences are a matter of taste more than of function. I for one prefer the taste of Expression Web, and don’t know what Dreamweaver offers that Expression Web doesn’t.

Expression Studio includes Expression Design which is functionally equivalent, albeit to a much lesser extent, to Adobe Illustrator. The rest of the Expression Studio suite accomplishes most of the same functional tasks for web design and development as Adobe CS4 Web Premium Suite’s offering. So, to be functionally complete, you’d need to add a graphics editor to Expression Studio before Expression Studio can be compared with CS4.

As for the costs,

Expression Web: $149
Expression Studio + Paint.NET = $599 + $0 = $599
Expression Studio + Adobe Photoshop: $599 + $699 = $1,198

However, I get Expression Studio for free as it is bundled with my Microsoft suite package. More on this later.

Adobe Dreamweaver: $399
Adobe CS4 Web Premium Suite: $1,699

Silverlight vs. Flash

Inevitably, “the Microsoft stack” has to run into the Silverlight stack because Microsft pushes that product out, too. I’m not going to get into the religious debate over whether Adobe Flash is better than Microsoft Silverlight, except to say a couple very important things. First of all, I understand that it’s a no-brainer that everyone has Flash. 98% of the web’s user base has it. That said, supporting Microsoft Silverlight for your user base—that is, getting your users to obtain it—is not hard at all. So let’s just get that out of the way, okay? Yes, I know that Silverlight comes at this cost of a one-click install versus a no-click install. Life goes on.

Okay. Let’s talk about tools. With Adobe Flash, you have three options, really, for developing Flash solutions: 1) Adobe Flash Professional, 2) Adobe Flex (an Eclipse-based IDE for developing Flash-based applications), or 3) third-party apps like SWiSH. Fortunately, Adobe has recently been rumored to be planning on merging Flash Pro and Flex functionality, which is a relief because Flex did not have the design power of Flash Pro and Flash Pro didn’t have the development power of Flex. Meanwhile, though, Flash Pro and SWiSH are hardly tools I can take seriously as a software developer, and unfortunately, at $249, Flex is expensive.

Microsoft, however, offers the functionally equivalent toolset with the Expression suite and with Visual Studio. The Silverlight Tools for Visual Studio integrate with Visual Web Developer, providing Silverlight developers a completely free IDE for developing compelling Silverlight applications. So let’s get that out of the way: You do not need to spend a dime on dev tools to develop Silverlight apps.

Expression Blend, however, which is a commercial product and is functionally comparable to Adobe Flash Professional as well as, in my opinion, Apple’s Interface Builder (with which iPhone application interfaces are designed), is a rich designer tool for Silverlight as well as for WPF (Windows applications) and outputting XAML, the XML markup required for Silverlight and WPF applications. It provides a syntax-highlighting, IntelliSense (code completion) ready code editor for C# and Javascript code, too, so technically you could accomplish much using just Expression Blend, but Microsoft (and I do, too) recommends using Expression Blend in combination with Visual Studio / Visual Web Developer 2008 Express.

Microsoft Visual Web Developer 2008 Express with Silverlight Tools: $FREE
Microsoft Expression Blend: $599 (full Studio suite)
Together: $599
Microsoft Expression Professional Subscription (Expression Studio plus Windows, Visual Studio Standard Ed., Office, Virtual PC, and Parallels Desktop for Mac): $999

Adobe Flex Builder: $249
Adobe Flash Professional: $699 (standalone)
Together: $948

The long and short of it: in terms of cost savings, Silverlight development costs are on par with Flash development costs, but can in fact go a lot further per dollar including at the price of $FREE, depending on how much tooling you need.

Databases

Then there are the databases. The non-Microsoft stacks include primarily mySQL and PostgreSQL, et al. Mind you, these databases work fine in a Microsoft world, too, just like everything else, but the Microsoft stack tends to work best with Microsoft SQL Server.

Okay, let me just say at this point that Microsoft SQL Server 2008 is, by far, a vastly superior RDBMS than most anything I have seen from anyone, in every respect. Don’t get me wrong, I greatly admire mySQL and the other RDBMSs out there, but SQL Server is seriously the bomb.

But let’s talk about pricing. Just like Visual Studio has a prohibitively expensive offering available to enterprise users, SQL Server 2008 Standard Edition comes to us at a whopping $5,999. That’s just a hair less than the price of my Toyota when I bought it (used).

But, once again, there’s an expensive commercial offering for everything under the sun. MySQL also has a commercial offering at $599, which I’ll admit is only 1/10th the cost of SQL Server standard edition but isn’t exactly free either.

But seriously, who comparing development stacks actually pays for this stuff? Read on.

Everything Starts At Free

Technically, one could download the SDKs (for free) from Microsoft and do most anything. Most of it would be from the command line, but even XamlPad.exe is bundled in with the Windows SDK to you create XAML files for WPF with a WYSIWYG preview. (For Silverlight, you might try Kaxaml’s beta release.)

But who on the Microsoft stack wants to use the command line? If you’re new to the Microsoft development stack, the first place you should turn to is the Express suite, which includes among other things Visual C# Express, Visual Web Developer Express, and SQL Server Express. Empowered with each of the components of the Express suite, you as a developer have all the extremely powerful tools you need to accomplish almost any development task, with absolutely no licensing fees whatsoever. There really is no fine print with this; the Express editions have a few functional limitations that are very rarely (if ever) showstopping, and you’re not allowed to extend the Express product and try to sell your extension or to redistribute the Express products themselves, but there’s no pricing structure at all for any of the Express suite downloads.

I must say, the 2008 flavors of the Express products are, far and away, the most powerful software development solutions I’ve ever seen as a free offering, and definitely compete fairly with the likes of Eclipse and NetBeans in terms of providing what the typical developer needs to build a basic but complete product or solution without a software budget. Ironically, in my opinion, Microsoft specifically created a web site for the Express flavors of Visual Studio to make it all look crappy compared to Visual Studio Team Suite. The Express web site does not do these tools justice. Combined, the Express products are very rich and powerful, and the web site makes them look like a boy’s play dough or G.I. Joe.

I must include SQL Server 2008 Express in saying that the Express products are very rich and powerful, particularly if you get SQL Server 2008 Express with Advanced Services including Management Studio Express, this RDBMS suite is insanely powerful and complete, and is by far more capable and powerful than mySQL. And no, people, SQL Server Express does not come with licensing restrictions. It’s free, completely free. Free, period. It has a few technical/functional limitations, such as for example it cannot consume more physical RAM (not to be confused with database size) than 1 GB, and there are limitations to redistributing the Express products. But there is otherwise no licensing fine print. You can use it for commercial purposes. Have at it.

Beyond these Express versions, there’s also #develop (pronounced “SharpDevelop”). #develop is a non-Microsoft IDE for developing .NET applications on Windows, and it’s quite functional. Initially I think it was built for Mono in mind, but in the long run it never implemented Mono and instead Mono took some of #develop and made it MonoDevelop. #develop is a very well implemented IDE and is worth checking out, particularly given its free price. However, since #develop isn’t a Microsoft tool, it’s not really part of the Microsoft stack.

The Cheap And Free Bundle Package Deals

If the Express flavors aren’t good enough for you, now I get to mention how to get everything you might ever need—and I really mean everything, including Windows Server 2008 R2 Enterprise Edition, SQL Server 2008 Enterprise Edition, Visual Studio Team Suite with Team Foundation Server, and Expression Studio—for absolutely no cost whatsoever. The only catch is that you must be needing this (a free offering). If you don’t need it because you have a heckofalot of money, then, well, go get a life.

Microsoft is still giving away all the tools you need to rely on the Microsoft stack for absolutely no cost whatsoever through a package deal called BizSpark, which basically gives any start-up company—including one-to-five-man micro-ISVs like yourself(??)—an MSDN Subscription with fully licensed rights to use everything under the sun for development tools and operating systems for absolutely no cost (except for a $100 closing fee after a couple years I think?). If you’ve been struggling as a business for more than three years or if your revenue exceeds $1mil a year, you don’t qualify, otherwise if you intend to create a product (including a web site hosted on IIS) that’s core to your start-up, you do. It’s as simple as that. But don’t take my word for it, read the fine print yourself.

[Added 9/26/2009:] If you’re not a software business start-up but more of a web services start-up, creating a web site, or are a web designer, there’s a brand spanking new program for you, too, that’s just like BizSpark but targets you specifically. It’s called WebsiteSpark. I’m injecting mention of this into this blog post but already discussed it in a follow-up post; here are the basics: For a $100 offing fee (a fee that you pay when your license ends, rather than when it begins) you get Windows Web Server 2008 R2, SQL Server 2008 Web Edition, Visual Studio 2008 Professional Edition, and Expression Studio 3, and your license ends in three (3) years (same as BizSpark).

But let’s say you’re not really in business, you’re a college student, and you just need the software, without the pressure of being monitored for pursuing some kind of profit. Assuming that you are indeed in college, there’s hope for you, too, a complete suite of software for you including Windows Server 2008 Standard Edition, SQL Server 2008 Standard Edition, and Visual Studio 2008 Professional Edition, among other things, through a program called DreamSpark. All you need to qualify is to be a student. Congratulations.

An older program I took advantage of a few years ago, while Microsoft was still experimenting with these package deals, was the Empower program, which is like the BizSpark program but costs a few hundred bucks and doesn’t give you the ridiculously extensive Team Suite edition of Visual Studio. You basically have a year or two to enjoy it, and must offer a product within that timespan, after which point they drop you. But it was still a great deal considering the alternative outside of BizSpark was full-on full-priced licensing.

If you want a “normal everyday customer deal”, the MSDN subscription is still a good option. For about $1,200 for the Visual Studio Pro with Premium MSDN, you get everything under the sun (everything in BizSpark), except only the Team Suite flavor of Visual Studio. I’d save up my money for that even now if I didn’t already have what I needed.

Finally, if these still aren’t good enough for you, let me just say that if you work for an employer who provides an MSDN subscription directly to you as an employee (and I’ve had at least five or six employers do this in my career), and you go and use one of the unused licenses of one of the products under MSDN for your own personal use, unless Microsoft or your employer actually bother to check the download or activation history of your MSDN account, *psst* hey buddy, nobody will ever know. *wink* Seriously, don’t pirate. But hey I’m just sayin’. If you’re careful to only use the licenses that are not being and won’t be used (and in most cases with MSDN subscriptions there’s a ton of them), nobody will care.

Windows Web Hosting

All these things said, if you’re building a web site, you don’t likely need to buy Windows at all, other than the Windows instance on which you’re developing your app. You can rely on a third party web host just like nearly everyone else does. The price for hosting an ASP.NET app on a Windows-based server is typically about 20% more than the Linux offerings, but start at $4.99. You typically have to pay a little bit extra, as well, for extensive SQL Server requirements, but the basics are usually bundled in with these hosted deals.

The Costs Of Knowledge

Honestly, at $4.99 or even $10 a month, I don’t know what people would be complaining about. That’s a good price to host a Microsoft tools based solution. Sure, I can get a Linux hosted site running somewhere at as little as $2.99, but this comes at a prohibitive cost to me. First of all, I like most PC users (“most” being statistically speaking) am already familiar with Windows. In order to use Linux hosting effectively, one must explore and consume a lot of knowledge that otherwise has no relevance to my existing work-and-play environment.

Well let’s assume, then, that I know neither, and that I only use Windows for e-mail and web browsing. Let’s assume that I’m looking at PHP vs. ASP.NET and mySQL vs. SQL Server Express.

Linux proponents will say that you can dive right into PHP and mySQL because Linux doesn’t cost anything. But if you’re already running a moderately recent version of Windows, which statistically speaking you probably are, then this point is completely moot. Even with Windows XP (which is nearly a decade old and is showing its flatulent age) you can accomplish much with the tools that are already available to you.

At that point, then, which direction you should choose is going to be purely a matter of taste, vendor support, learning curve, and culture, because you can do pretty much anything on the Microsoft stack absolutely for free, or cheaper than the non-Microsoft alternative (i.e. Expression Studio vs. CS4), at every level, with no or very few strings attached.

I’d argue, then, that the cost of knowledge is the only significant cost factor if you already have Windows and you’re just doing your own thing. Both the Microsoft and the non-Microsoft user communities are strong and will assist you as you learn and grow. However, I prefer the Microsoft path specifically because the education, training materials, documentation, and, yes, marketing, all come from one vendor. It’s not lock-in that I want, not at all, so much as it’s the consistency that I enjoy (not to mention the intuitiveness of the Microsoft platform at every level from a user’s perspective). Everything starts with MSDN and Microsoft employees’ blogs, for example, and from there I get everything I need from help on how to use new C# language features to how to use Visual Studio to how to configure or extend IIS. Whereas, with the LAMP community, everything is fragmented and fractured. If that’s your preferred style, great. Just keep in mind that Windows can do everything you’re already doing in Linux. ;)

[Added 9/26/2009:] As I mentioned (er, injected) above under “The Cheap And Free Package Deals”, Microsoft just created a new program called WebsiteSpark. In addition to the Windows, SQL Server, Visual Studio, and Expression Studio licenses, you also get professional training. This training is still “coming soon”, I suspect it’ll be online training, but it’s professionally produced training nonetheless (no doubt).

Discussions In The Community

Browsing the comments at http://stackoverflow.com/questions/1370834/why-is-microsoft-stack-said-to-be-costly/1376168#1376168 infuriates me. This is actually the reason why I felt compelled to post this blog article. I am so sick and tired of the FUD that ignorant anti-Microsoft proponents keep pumping out. I’m going to assume that the OP’s context was for web applications, but it doesn’t matter much either way.

  • “But still, Linux hosting is cheaper than Windows hosting at pretty much every level.”

Ahh yes, web hosting. At $4.99 or even at $10 per month I really don’t care.

If we’re talking about VPS or dedicated server hosting, that’s another story. Let’s just say I have a Linux VPS I pay $30/mo. or so for, but I really don’t use it for much because it just doesn’t do enough for me reliably and intuitively, and meanwhile this blog is hosted on a $160/mo. virtual dedicated server (hosted) with Windows Server 2008, but it’s heavily used. I feel I get what I pay for.

  • “Linux hosting is almost always cheaper for the simple reason that the MS stack costs the host more to license (which is the point of most posts). Also you don't get development tools with a hosting service. Let's not forget that you're also liking going to need a more expensive "Ultimate Developer, Don't Gimp It" version of Windows desktop to run the dev tools.”

I don’t know what “Ultimate Developer, Don’t Gimp It” means, but I do agree that Ultimate is the best flavor of Windows to do development on. However, you don’t need Ultimate edition to do Microsoft stack development. Visual Web Developer (which is free) comes with its own test web server and installs fine on Windows XP Service Pack 2 or on Windows Vista Home Basic. And its output works great at targeting Windows based web hosts.

  • “I've heard of express editions. I've even downloaded some. I seem to remember a license condition about non-commercial use, although I may be wrong. I don't think the express editions are particularly good for commercial development in any case.”

Hogwash. The Visual Studio Express editions are blatantly characterized on Microsoft’s pathetic Express web site as being cheap, simple, and even a little crappy, but in fact they are extremely functional and capable of doing much more than “hobbyist” solutions. The suite is really very powerful and I for one believe that if Microsoft only had the Express suite and sold it as their commercial offering it would still be a powerful, viable platform for many shops. And yes, you’re allowed to use it for commercial development, and it works great for it.

However, as described above, there are ways to get the Professional and Team Suite editions of Visual Studio and SQL Server Developer Edition (full) without shelling out a lot or even any money.

  • “I don't know Microsoft's specific licensing policies (I can assume they are pretty reasonable), but I can tell you that developer tools are often more pricey than you'd imagine when you start licensing for your company.
    Often when you start buying developer licenses for teams of, say, 20-50 you are starting to talk about millions of dollars up front costs. $100,000 per developer wouldn't be unheard of (not counting the often mandatory annual support fees which can double that number easily).”

Ridiculous. $10,000, which is a tenth of what this guy said, is all it costs to get everything under the sun without one of the special deals like BizSpark. And if you have a team of that size and you’re an established corporation, it would be below you to still be asking the question, “Is the Microsoft stack really more expensive?” It will be business. And I must say, Microsoft doesn’t suck at supporting its fully-paying customers.

At any rate, I must say again, BizSpark (bundled suite of everything) is completely free, with a $100 closing fee.

  • “If you want to use ASP.NET you need
    • IIS
    • A server with Windows (for IIS)
    • Visual Studio
    • A work station with Windows for Visual Studio

    If you want to use PHP, Perl, Mono, Ruby... you need

    • A web server that supports the technology wanted. May be Apache, IIS...
    • An OS that supports your weberver
    • A workstation with any Linux, Window or mac”

This is silliness. If you want to use ASP.NET, you can go Mono all the way on Mac or Linux and never touch Windows or IIS. But ASP.NET wasn’t the discussion; the Microsoft stack was the discussion.

The Microsoft stack infers Microsoft being the vendor at every primary level of the software stack. So of course you need Windows. (And for the third or fourth time, statistically speaking you probably already have it.) And Mono wouldn’t count because it’s not Microsoft, so of course you need IIS. #develop (SharpDevelop) and other non-Microsoft development IDEs don’t count because they’re not Microsoft, so of course you would probably use Visual Studio.

On the other hand, “needing IIS” has no meaning because it’s a part of Windows, it’s like saying you need a hard drive, plus you need a computer (to contain the hard drive). It comes at no cost. It’s not a product, it’s a technology component of Windows.

Visual Studio is also not needed, rather it’s available as an option, and its Express flavors are free. You can also use vi, emacs, Notepad.exe, whatever you like. There is literally nothing that LAMP developers enjoy in their development lifecycle that they cannot establish with the Microsoft stack. If you want to write in vi and compile with a command line using ant and make, great, use vi and NAnt and NMake or MSBuild. If you like your command shells, great, most of the Linux command shells are available in Windows, plus Windows’ PowerShell. Have at it. But please, please don’t assume that you have to use Visual Studio if you use the Microsoft stack but you get to use simpler tools for LAMP development. The Microsoft stack has all those simpler tools at its disposal, too. (Yes, all for free, with the Windows SDK.)

  • “I don't think they're talking about the time required to develop on the Microsoft stack. They're talking about the cost of:
    • tools (Visual Studio, Resharper);
    • operating systems (Windows Vista, Windows Server); and
    • databases (SQL Server 2005/2008).”

*sigh* Need I say more and repeat myself? And if Resharper was available for PHP/Ruby, and I was doing PHP/Ruby development, I’d pay for that, too.

 

Introducing The Gemli Project

by Jon Davis 23. August 2009 21:11

I’ve just open-sourced my latest pet project. This project was started at around the turn of the year, and its scope has been evolving over the last several months. I started out planning on a framework for rapid development and management of a certain type of web app, but the first hurdle as with anything was picking a favorite DAL methodology. I tend to lean towards O/RMs as I hate manually managed DAL code, but I didn’t want to license anything (it’d mean sublicensing if I redistribute what I produce), I have some issues with LINQ-to-SQL and LINQ-to-Entities, I find nHibernate difficult to swallow, I have some reservations about SubSonic, and I just don’t have time nor interest to keep perusing the many others. Overall, my biggest complaint with all the O/RM offerings, including Microsoft’s, is that they’re too serious. I wanted something lightweight that I don’t have to think about much when building apps.

So as a project in itself I decided first to roll my own O/RM, in my own ideal flavor. Introducing Gemli.Data! It’s a lightweight O/RM that infers as much as possible using reflection, assumes the most basic database storage scenarios, and helps me keep things as simple as possible.

That’s hype-speak to say that this is NOT a “serious O/RM”, it’s intended more for from-scratch prototype projects for those of us who begin with C# classes and want to persist them, and don’t want to fuss with the database too much.

I got the code functioning well enough (currently 92 unit tests, all passing) that I felt it was worth it to go ahead and let other people start playing with it. Here it is!

Gemli Project Home: http://www.gemli-project.org/ 

Gemli Project Code: http://gemli.codeplex.com/

Gemli.Data is currently primarily a reflection-based mapping solution. Here’s a tidbit sample of functioning Gemli.Data code (this comes from the CodePlex home page for the project):

// attributes only used where the schema is not inferred
// inferred: [DataModelTableMapping(Schema = "dbo", Table = "SamplePoco")]
public class SamplePoco
{
    // inferred: [DataModelFieldMapping(ColumnName = "ID", IsPrimaryKey = true, IsIdentity = true, 
    //     IsNullable = false, DataType = DbType.Int32)] // note: DbType.Int32 is SQL type: int
    public int ID { get; set; }

    // inferred: [DataModelFieldMapping(ColumnName = "SampleStringValue", IsNullable = true, 
    //     DataType = DbType.String)] // note: DbType.String is SQL type: nvarchar
    public string SampleStringValue { get; set; }

    // inferred: [DataModelFieldMapping(ColumnName = "SampleDecimalValue", IsNullable = true, 
    //     DataType = DbType.Decimal)] // note: DbType.Decimal is SQL type: money
    public decimal? SampleDecimalValue { get; set; }
}

[TestMethod]
public void CreateAndDeleteEntityTest()
{
    var sqlFactory = System.Data.SqlClient.SqlClientFactory.Instance;
    var dbProvider = new DbDataProvider(sqlFactory, TestSqlConnectionString);

    // create my poco
    var poco = new SamplePoco { SampleStringValue = "abc" };

    // wrap and auto-inspect my poco
    var dew = new DataModel<SamplePoco>(poco); // data entity wrapper

    // save my poco
    dew.DataProvider = dbProvider;
    dew.Save(); // auto-synchronizes ID
    // or...
    //dbProvider.SaveModel(dew);
    //dew.SynchronizeFields(SyncTo.ClrMembers); // manually sync ID

    // now let's load it and validate that it was saved
    var mySampleQuery = DataModel<SamplePoco>.NewQuery()
        .WhereProperty["ID"].IsEqualTo(poco.ID); // poco.ID was inferred as IsIdentity so we auto-returned it on Save()
    var data = dbProvider.LoadModel(mySampleQuery);
    Assert.IsNotNull(data); // success!

    // by the way, you can go back to the POCO type, too
    SamplePoco poco2 = data.Entity; // no typecast nor "as" statement
    Assert.IsNotNull(poco2);
    Assert.IsTrue(poco2.ID > 0);
    Assert.IsTrue(poco2.SampleStringValue == "abc");

    // test passed, let's delete the test record
    data.MarkDeleted = true; 
    data.Save();

    // ... and make sure that it has been deleted
    data = dbProvider.LoadModel(mySampleQuery);
    Assert.IsNull(data);

}

Gemli.Data supports strongly typed collections and multiple records, too, of course.

var mySampleQuery = DataModel<SamplePoco>.NewQuery()
    .WhereMappedColumn["SampleStringValue"].IsLike("%bc");
var models = dbProvider.LoadModels(mySampleQuery);
SamplePoco theFirstSamplePocoEntity = models.Unwrap<SamplePoco>()[0];
// or.. SamplePoco theFirstSamplePocoEntity = models[0].Entity;

Anyway, go to the URLs above to look at more of this. It will be continually evolving.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

C# | Open Source | Software Development | Pet Projects

Office and COM interop with .NET: *Now* I'll give you a second glance

by Jon Davis 10. July 2009 14:27

Well we're not quite a decade yet--certainly a lot longer than five years, though--since .NET came out and promised to be the next big thing for programming. C# was supposed to put VB6 to shame. It didn't, though, because with VB6 you had such things as optional parameters and variants--the latter being an ugly beast but under the covers the flexibility that VB6 was made programming so much quicker and easier sometimes.

Now that C# 4.0 introduces optional parameters and dynamic objects, the whole playing field is changing. And now I can feel a bit freer to tinker with old-school technologies built on COM in my language of choice because the language has finally caught up with last decade's featureset in this respect.

I like this somewhat recent blog post by SamNG:

http://blogs.msdn.com/samng/archive/2009/06/16/com-interop-in-c-4-0.aspx

Lets look at a quick Office example.

	static void Main()
	{
	Word.Application app = new Word.Application();
	object m = Type.Missing;
	app.Documents.Add(ref m, ref m, ref m, ref m);
	}
	

This is such typical code! I have to struggle with the type system to make it happy, just to add a simple Word document!

... [With C# 4.0] in the following code, call (1) gets transformed into call (2).

	static void Main()
	{
	Word.Application app = new Word.Application();
	// (1) Your initial call.
	app.Documents.Add(Type.Missing, Type.Missing, Type.Missing, Type.Missing);
	// (2) Compiler generates locals and inserts them.
	object m = Type.Missing;
	app.Documents.Add(ref m, ref m, ref m, ref m);
	}
	

The great thing about this too, is that with the introduction of named and optional arguments, and using the fact that the feature generates Type.Missing in place of default values for object on COM types, we can simply remove the arguments altogether!

	static void Main()
	{
	Word.Application app = new Word.Application();
	// (1) Your optional-parameter-omitted initial call.
	app.Documents.Add();
	// (2) Compiler generates locals and inserts them.
	object m = Type.Missing;
	app.Documents.Add(ref m, ref m, ref m, ref m);
	}
	

Pretty cool stuff huh? Definitely makes programming against the Office APIs much nicer.

Yup. Indeed.

Visual Studio Debugger Tips (cont'd)

by Jon Davis 8. July 2009 10:29

Here's another good article with debugger tips:

http://geekswithblogs.net/sdorman/archive/2009/02/14/visual-studio-2008-debugging-tricks-ndash-multi-threaded-debugging.aspx

Have you ever hit Break while debugging a multi-threaded console app and the only thing VS tells you it's still on is ReadLine(), where it's waiting for some input but meanwhile some other threads are working and you can't see them? The above-referenced article showed me how to access those other threads. It's all at:

Debug menu -> Windows -> Threads

Visual Studio Debugger Tips You Need To Know

by Jon Davis 22. June 2009 17:45

Came across this article today. It's probably very old, as it's on an ASP Classic file and has no date.

 http://www.eggheadcafe.com/articles/20050511.asp

Good stuff, I didn't know or forgot about half of that stuff. IMO, using a debugger correctly (vs. constant logging and alert pop-ups) is huge when measuring one's productivity.

Incidentally, When looking for a "breakpoints window" I ended up being rather pleased to find that there's a right-click context menu in the breakpoint gutter after a breakpoint has been set in the text editor, revealing:

  • Location - Break execution when the program reaches this location in a file: File: [file path]; Line: [##]; Character: [##]; [checkbox] Allow the source code to be different from the original version
  • Condition - When the breakpoint location is reached, the expression is evaluated and the breakpoint is hit only if the expression is true or has changed. [checkbox] Condition: [textbox] [radio]: Is true; [radio]: Has changed
    • Yessss!! I've SO badly needed this one, I don't know how many times I've pounded F5 while staring at my Watch window waiting for some string to show up in a loop, or actually wrote inline code like
      if (condition && System.Diagnostics.Debugger.IsAttached)
          System.Diagnostics.Debugger.Break(); // my head open against the wall
  • Breapoint Hit Count - A breakpoint is hit when the breakpoint is reached and the condition is satisfied. The hitcount is the number of times the breakpoint has been hit. When the breakpoint is hit [drop-down]:
    • break always
    • break when the hit count is equal to [##]
    • break when the hit count is a multiple of [##]
    • break when the hit count is greater than or equal to [##]
  • Filter - You can restrict the breakpoint to only being set in certain processes and threads. Enter an expression to describe where the breakpoint should be set, or clear the expression to have the breakpoint set in all processes and threads. You can combine clauses using & (AND), || (OR), ! (NOT), and parentheses. Sample clauses:
    • MachineName = "machine"
    • ProcessId = 123
    • ProcessName = "process"
    • ThreadId = 123
    • ThreadName = "thread"
  • When Breakpoint Is Hit - Specify what to do when the breakpoint is hit.
    • [checkbox] Print a message:
      • sample: "Function: $FUNCTION, Thread: $TID $TNAME"
    • [checkbox] Run a macro: [macros drop-down]
    • Continue execution
Wow, that's some powerful breakpoint logic I didn't realize was right under my nose.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Software Development

My ‘Aha!’ Moment With Javascript

by Jon Davis 14. May 2009 01:25

9/27/2012 Note: This is an old 2009 blog entry, and it was recently promoted on DZone with no intention of making it a Big Link. I've since learned quite a bit more about Javascript fundamentals, correcting a few misgivings presented here, and you should, too. 

-- 

For most people this goes back to Javascript 101 but it’s worth blogging, in my opinion. A lot of people truly have no idea how much power is available on the client side of web apps, and they actually think that Javascript is dying.

The true power of Javascript was not made known to me until I had my aha! moment. It was about two or three years ago, and I think I could sum up (profusely, with freeze-dried concentration) what triggered my realization when these two essential facts became clear:

Discovery #1:

 

var myFunc = function() { };
var myObj = new myFunc();

 

.. is to Javascript what this is to C# ..

public class MyClass 
{
public MyClass() { } 
}
MyClass myObj = new MyClass();

 

 

That is to say, Javascript functions are functions (of course) but also “classes” (object prototypes) and constructors all rolled into one. So, for example, to accomplish this in C# ..

class MyClass {
void DoSomething() {
MessageBox.Show("something");
}
}
... 
MyClass myObj = new MyClass();
myObj.DoSomething();

.. you could do this in Javascript ..

function myFunc() { }
myFunc.prototype.doSomething = function() {
alert('something');
};
...
var myObj = new myFunc();
myObj.doSomething();

 

Or, you could assign the doSomething member function “at runtime” (dynamically appending the member to the object after the object has already been instantiated).

var myFunc = new function() {
this.doSomething = function() {
alert('something');
};
};
var myObj = new myFunc();
myObj.doSomething();
// or even
myObj.doSomethingElse = function() { alert('something else'); };
myObj.doSomethingElse();

Note that ‘this’ is used to reference the object instance that the function instance is. Incidentally, you can ensure “this” works when calling other objects’ functions by using function_name.call(object, params);.

That said, these things point out the dynamic nature of Javascript object members – you can append properties and functions to an object at runtime by using syntax like [object].doSomething = function() { }. It also shows that members on an object are akin to a string-keyed hashtable.

And that hashtable-like behavior brings about the second part of my “aha!” moment.

Discovery #2:

All user-defined objects, including functions, are ultimately string-keyed hashtables. That is not a limiting behavior but an extra feature because they are still real objects.

But JSON (Javascript object notation) objects are extraordinarily handy as alternatives to functions because of the expressive way you can declare them.

var myNewObject = {
member_A : "abc",
member_B : 123
};

.. is akin to C#’s ..

Dictionary<string, object> myNewObject = new Dictionary<string, object>();
myNewObject["member_A"] = "abc";
myNewObject["member_B"] = 123;

And it’s even more powerful when you consider that the members can be functions.

myNewObject = {
doSomething: function() {
alert('something');
}
};
myNewObject.doSomething(); // invoke
// or,
myNewObject = { };
myNewObject.doSomething = function() {
alert('something');
};
myNewObject.doSomething(); // invoke

.. can be implemented in C# 3.0 like so ..

delegate void SimpleMethod();
public static void RunSnippet()
{
var myNewObject = new Dictionary<string, object>();
myNewObject["doSomething"] = (SimpleMethod)(() =>
MessageBox.Show("something")
);
// .. 
((SimpleMethod)myNewObject["doSomething"])(); // invoke
}

In fact, take a look at this old blog post I saw at Ajaxian.com: http://colinramsay.co.uk/diary/2008/04/02/javascript-generation-a-change-of-heart/

In return, comparing the two languages reveals the power of C# 3.0, as well. C# 4.0’s dynamic objects will be trying even harder to “be powerful like Javascript already was”.

*evil grin*

Set Up IIS For An MVC App: When All Else Fails, Check View Config

by Jon Davis 29. April 2009 17:22

I got stumped today when trying to set up a CruiseControl.NET+RoboCopy powered development server deployment for an ASP.NET MVC web app. I set up MVC Framework (gets MVC into the GAC), did the wildcarding in the IIS app config, and everything worked fine, except for strongly typed views. I was confounded. The Event Viewer showed:

Exception information:
    Exception type: HttpParseException
    Exception message: Could not load type 'MyMvcApp.ViewPage<MyModel>'.

This turned out to be caused by a simple mistake. After cc.net compiles the app, RoboCopy copies all the .aspx files over to the web app, and ignores the .cs files, the .config files, etc., so that the .config files don’t get overwritten. I had manually deployed the main web.config file for the app, but I forgot that the Views directory also has a web.config.

Why there is a web.config in the Views directory, I don’t know yet. But the extra .config file in the Views directory is absolutely mandatory to get an MVC app working on IIS, or at least on IIS 6 anyway (haven’t tried 7).

Visual Studio 2008 Crashes When Using ASP.NET MVC (Nasty, NASTY Bug!)

by Jon Davis 16. April 2009 10:05

Some people (like me) have had issues with Visual Studio 2008 suddenly disappearing without errors when the developer user opens up an .aspx file, a .master file, or some other code file in an ASP.NET MVC project.

Had this show stopping issue beat me black and blue over the last 24 hours. I finally got past it when I used the /safemode switch with devenv.exe, but that disables all my lovely add-ins like Resharper. :(

Finally, one of the team members pointed me to “NDP20SP2-KB963676-x86.exe”. He had the same issue and tried to run this hotfix and it worked for him.

It seems to be working so far for me, too. The hotfix is here:

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&wa=wsignin1.0

File for Windows XP: NDP20SP2-KB963676-x86.exe

More info here: http://www.google.com/search?q=KB963676

Unity 3D On Windows: It’s The Real Deal

by Jon Davis 19. March 2009 23:30

As curious as I am about all the exciting MIX09 announcements, I was equally curious if not more curious about the announcement from Unity Technologies that Unity 3D is now available on Windows (no longer beta). This is a major, major cross-platform game engine, world builder, and development IDE all in one, that builds 3D games for both Windows and Mac (PPC and Intel) and on the web as a browser plug-in (Silverlight/Flash style). (The Mac version supports deployment to iPhone as well, but the Windows version doesn’t.) The programming language is C#, using a tweaked out processor-natively compiled implementation of Mono (no this has absolutely NOTHING to do with Moonlight), and processor-natively compiled Javascript.

windows_gui This announcement is big because the development toolset has been available on the Mac for some time, but the reality is that there are far more potential game developers, particularly C# programmers, who prefer Windows over Mac for development. This is not to say that Mac isn’t the superior operating system or that Windows is, I’m just acknowledging the statistical fact that Windows has more users, whether those users are end-users or the MSDN crowd.

I downloaded Unity for Windows and yes, it’s pretty much the same thing as what I saw on the Mac a year or so ago, which was one of the two big motivators to buy a Mac Mini in the first place (this and the iPhone SDK), to dabble and discover.

In the end I ultimately shrugged off my Mac Mini because I mostly thrive on my Vista-based laptop. But now I can do this Unity stuff on my laptop, in the comfort of my living room. So while it still might be too late (I only have so much time in the evenings to screw around with these things) in that I might be just short of having sufficient curiosity to be willing to prioritize Unity over other pet projects, we’ll see. Unity won itself another chance.

A warm CONGRATULATIONS and THANK YOU to Unity Technologies for making the sensible move to support the Windows developer community.

Microsoft’s XNA team should be inspired. I’d love to see Unity-like tools added to the XNA Game Studio.

The one thing that keeps me hesitant to say that Unity is the end-all be-all or “this is the way things should be done” is simply the fact that, like GarageGames’ Torque and Epic Games’ UnrealED, Unity imposes a baseline game engine, an OpenGL-based virtual world engine, which makes things easier to work with but doesn’t give a programmer the opportunity to build a game’s core from scratch. Fortunately, at least Unity 3D’s virtual world engine doesn’t impose a landscape and physics like Torque does. But I just admire XNA’s true open-endedness.

I guess what I’m saying is that with Unity I’d like to see “Cornflower Blue mode”, so to speak. When I think of game development, I don’t think of 3D meshes and media assets and X/Y/Z coordinates so much as I think of ticks, vectors, and graphics programming. I’m a programmer.

And one type of game I keep wanting to get around to making is a Wing Commander / Freespace style space flight sim. Torque didn’t lend itself to that. XNA was fine for that, I suppose, I just didn’t have time, but Unity brings a lot of joy to game production in general, and so now I’m torn. (Meh.)

One other thing I’m curious about is whether there are technical limitations or ramifications of combining Silverlight and the Unity 3D browser plug-in in layers. Unity doesn’t have XAML support, and Silverlight doesn’t have rich 3D and audio support. XNA meanwhile is completely ignoring the web.


 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  January 2021  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar