11 Mar 2008

IE8 - The developers best friend

There are a few good reasons to use IE 8 as a developer but yesterday I found my new favorite. When using Visual Studio 2008 and running the site a new section appears in the solution explorer called Script Documents. In this little gem of a folder is the pages you are looking at, the scripts etc... all as the server provided them to the browser! Meaning if you open the .aspx page there is no ASP controls, just normal HTML. If you do inserts of JavaScript via OnInit, that is there as well. Amazing!

AttachmentSize
Image icon cool.png13.01 KB
03 Jan 2008

Essential Developer Tools - Part 4: Static Analysis Tool

Static analysis is the process of having a tool scan at your compiled and/or uncompiled code for things like bad practises, maintainabilty, performance and security issues and so on. If you have Visual Studio Team Edition or better then you have the built in tool which is based on the free FxCop. Wikipedia contains a nice list of various tools available, but the reason why FxCop/VS is so much better is the help on the issues. All the help contains samples and information on the how and why of the problem and solutions for it. This actually becomes more than a tool to ship software but a great learning aid for the developer using it.
27 Dec 2007

.NET Framework 3.5 - Part 3: Extensions

In my previous post I spoke about some of the new features in 3.5. For ASP.NET though there is more goodness coming in the form of the ASP.NET 3.5 Extensions package. This package contains some interesting bits I want to highlight.
  • ASP.NET MVC: This model view controller (MVC) framework for ASP.NET provides a structured model that enables a clear separation of concerns within web applications, and makes it easier to unit test your code and support a TDD workflow. It also helps provide more control over the URLs you publish in your applications, and more control over the HTML that is emitted from them.
  • ASP.NET Silverlight Support: With the ASP.NET 3.5 Extensions release we'll deliver support for easily integrating Silverlight within your ASP.NET applications.  Included will be new controls that make it easy to integrate Silverlight video/media and interactive content within your sites.
  • ADO.NET Data Service (codename "Astoria"): In parallel with the ASP.NET Extensions release we will also be releasing the ADO.NET Entity Framework.  This provides a modeling framework that enables developers to define a conceptual model of a database schema that closely aligns to a real world view of the information.  We will also be shipping a new set of data services (codename "Astoria") that make it easy to expose REST based API endpoints from within your ASP.NET applications.
There are a few more and Scott Guthries post will be good to cover if you are interested (all the info above is from him).

Now starting with Silverlight support thats a no brainer really. If your market is developers wanting great tools, then making them edit HTML to get your new platform is a little tougher than need be. The MVC is a nice thing if you believe the information on it (I haven't used it yet myself) but it basically is bringing a lot of the CCF/CAB ideas to the web in a elegant way. Lastly Astoria is a great technology (I almost built my own for a project but beta 1 came out and saved me from that) which gets your data from within the black box of servers on to the web in a way it can be consumed by client applications easily. Obviously performance doesn't compare to ADO.NET directly but if you don't have access to the server this is the way to share information.
19 Dec 2007

Essential Developer Tools - Part 3: UDL Files

One thing about being a developer is that at some point you will have to work with databases/datastores. It's a fact of life (like death and taxes). The thing about these databases is that they all have connections strings to get to them, but the problem is how do you get the connection string? A popular website is http://www.connectionstrings.com/ which lists them and you can then copy, paste and modify those for your own needs.

However there is a problem with this, in that it's open to errors during the modification (assuming you can copy and paste without error) and that there is no nice test system for your environment. Well fear not, Windows (I've known about this since Windows 2000 and can confirm it works on XP, Vista and 2003 fine) has a great feature for finding out connection strings, and testing them.

To do this you create a new empty file somewhere (desktop is good, cause you can go right click New -> Text Document). The trick is to make sure the file extension is udl (i.e. connection.udl). Now you can double click this file and using the (possibly) familiar connection wizard/odbc thing to set and test the values the values:
Once you click OK the window disappears.

So what good is that? Well if you now open that file in notepad you'll find the connection string in plain text right there! With all the right values for your environment! Anyway happy connecting!

Update 10 Jan 2008: If you are doing this on x64 machines and getting issues this may help: http://blogs.msdn.com/snehadeep/archive/2008/01/10/running-a-32-bit-data-link-properties-udl-in-64-bit-box.aspx
AttachmentSize
Image icon demo.png32.78 KB
17 Dec 2007

.NET Framework 3.5 - Part 2: What's new in it?

For the sake of the series I am going to just highlight a few points. For real concrete stuff see:

There is a lot of new language features in 3.5, most important to highlight for this series is LINQ. Moving along to the more shiny information there is significant work put into integration of AJAX, WPF (XBabs support in Firefox, can work with cookies now), WCF (more WS* support, general syndication support, special model for web development,  and Silverlight. WCF + WF and WCF + AJAX now play very well together (lots of support for each other now). There is also support for new cryptography stuff (nice), peer to peer development. Interesting WinForms now supports the same model as ASP.NET for authentication.
14 Dec 2007

Essential Developer Tools - Part 2: Microsoft patterns and practise

There is a scene in Jurassic Park where Ian Malcolm (If I remember right, he is the mathematician/chaos theorist) criticizes Jurassic Park for not earning the right to clone the dinosaurs as they just "Stood on the shoulders of those before them". Well that may be true when working with millions of years old dinosaurs, but in development standing on the shoulders of the greats makes life better for you as a developer and for your clients.

Being a Dot Net developer means that those giants include the Microsoft patterns and practices team. Well what do they do?

We talk with a large number of Microsoft customers, partners, and consultants to understand the commonly occurring scenarios and the technical challenges associated with them. Then we discover and harvest the solution patterns and engineering practices (including anti-patterns) that have proved successful in addressing these scenarios.
Once we understand the scenarios and technical challenges, we work with product and technology teams across Microsoft, industry experts, and with customers and partners, to build guidance that reflects both the current, practical state of the technology and that is also aligned with future Microsoft technology plans. Often, the underlying scenarios and solutions guidance ends up influencing future Microsoft product direction.
Most of our projects are conducted in CodePlex communities. This allows continuous input from the development community at large and keeps us honest. We call this approach, “customer connected engineering” and it ensures that what we deliver actually meets the needs of our customers. We also ship the source code to nearly everything we deliver, usually along with a license agreement that encourages source level adoption and customization.

From http://msdn2.microsoft.com/en-za/practices/bb969103(en-us).aspx

That's great for marketing but for developers it means that they produce tools, frameworks and documentation (guides, proven practices etc...). My personal favorite from them is a set of components called the Enterprise Library which provides amazing code for logging (log4net eat your heart out), database access, exception handling, cache handling, cryptography, policy management (ala AD policies in your app) and validation. It really is amazing stuff. Two nice examples are the database application block, you can connect to a database, run a query and get the result in result set and close the database all following best practices with a tool to change the connection string (cause it's not hard coded so your users may need it) all in 2 lines of code! The validation block provides attributes to decorate your classes with to enforce validation with no additional code. You can get all of that from http://msdn2.microsoft.com/en-us/library/aa480453.aspx and much more from http://msdn2.microsoft.com/en-za/practices/bb969097(en-us).aspx.

13 Dec 2007

.NET Framework 3.5 - Part 1: Where you can find it?

There is the logical place on the Microsoft site but if you installed Visual Studio 2008 you have it already (including 2.0, 3.0) all in 32 and 64 bit. Now in VS 2005 this was under the Visual Studio folder in Program Files. With VS 2008 it moved to being part of the Windows SDK, so you can now find it in (assuming you installed to default locations, else modify as needed):
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

BTW one nice feature of using this version, is that you have all 60Mb already downloaded. So when you launch it, and it says you need to download a bunch of data - well you give it a second cause it doesn't.
13 Dec 2007

Essential Developer Tools - Part 1: Reflector Plugins

One of the most powerful tools in a developers kit (and an essential for CCF development) is reflector. Up until now I always assumed (incorrectly) plug-in's added other language support. That is until I stumbled on to a great codeplex site. This site lists a large number of plug-in's be them on codeplex or not.

The site is: http://www.codeplex.com/reflectoraddins

Some of the nice ones there:

  • Code Metrics
  • Code Review Tools
  • Dumping of source code to file
  • Silverlight support
  • SQL 2005 (for CLR integration) support
  • Unit and mock testing
  • BizTalk Support
  • A few diagram and charting tools
  • Powershell support (as a language)

There are a lot of other nice ones but those are really great.

Pages