More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Taming the JunglePhotosProfileFriendsMore Tools Explore the Spaces community

Taming the Jungle

The joys and perils on being in the bleeding edge of software development technology.

Mauro Sant'Anna

View spaceSend a message
Mauro has more than 20 years experience in software development. He authored several software packages sold in Brazil and USA. Later he focused on teaching software development. He has developed courseware on Windows, SQL and .NET development using several programming languages such as C, C++, Pascal, Delphi, C# and VB.

Mauro spoke in several industry events such as BorCon (Borland – 1994/1995), the Brazilian versions of PDC (2003, 2004) and TechEd (2001-2005), IDG events and many more. Mauro is an accomplished magazine columnist having written 100s articles for several publications including IDG’s, Fawcette’s and MSDN Magazine Brasil.

He taught the first .NET class in Brazil in September 2000 and has since been hired by Microsoft and others to teach .NET classes. He taught classes for Microsoft on VS.NET 2005 and WCF in Brazil, South Africa, Costa Rica and Dubai.

Mauro is a MVP (Developer Security), Regional Director and INETA Speaker and holds MCSD, MCSE, MCDBA and MCT certifications.
No list items have been added yet.
No list items have been added yet.
No list items have been added yet.
June 26

Data Access Debate

I’ve been yet again involved in some discussion about ORM tools and data access architectures. Here is my take.
 
There’s a lot of “religious” discussion when talking about ORM in general; few people have unbalanced views. Maybe because when you are fresh in the field you simply can’t have an opinion – it’s a very complicated matter. Later on when you do have experience you also have a lot of baggage in the form of assumptions and preconceptions about how things do and don’t work. I consider myself in the “against ORM” group; I think that ORM tools like NHibernate would do more harm than good in 90% of the projects I’ve been involved in and are bound to be misused by 98% of the developers I met, if left to their own devices.
 
My focus lately is mostly with LOB applications developed by non-rocket-scientists developers. In this environment things are not individually complex but are extensive: we are talking hundreds or even thousands of forms/pages/reports. High productivity using run-of-the-mill developers is paramount. Having half a dozen very senior and experienced people is not an option. I particularly like typed DataTables because of the Visual Studio designer support and easy data binding.
 
This is what I have been doing so far with some success, in a nutshell:
  1. Do some light requirement/analysis phase. Do use fake screenshots/prototypes. The UI s the place where the conceptual model of the end user and the software intersect; take advantage of that.
  2. Design the database very carefully based on the analysis. Discuss with the user again in case of doubt.
  3. Create a stateless DAL layer using the designers available with Visual Studio 2005/2008; Typed DataTables/DataAdapters for CRUD operations and others simple things. We have some heuristics as to what to create “mechanically” based on the database, all in the solution domain. I wish I had a code generation tool that would use the heuristics, like “add a method that returns a row given the primary key” . Maybe the developer would use an even simpler designer than the one that already comes with Visual Studio, but as Billy Wilder put in “Some Like it Hot”,  “nobody is perfect”. I used to have a code generator tool for VS 2002/2003 but I didn’t upgrade it. Besides not supporting the “heuristics”, Visual Studio lacks support to sets (IN SQL operator) and some form of meta-WHERE clause immune to SQL injection. I can do both with some code and partial classes.
  4. Based on the requirements, design a stateless business layer. This layer defines and exposes new typed DataTables (not TableAdapters) as an important data type. Those DataTables are based on the problem domain (screens, for instance), *not* the database. This layer basically translates via code from the problem domain to the solution domain, something ORM tools propose to do via “mappings”. BTW, I have no shame using high level imperative languages such as C# rather than some supposedly superior declarative “magic sauce”. It also implements business rules and impose sequence, things not easily achievable (or at all achievable) by “ORM mappings”. This layer also implements authorization (usually role-based) and transactions (usually with the Lightweight Transaction Manager). If you need to expose services, this layer already has mostly the right semantics; you can mechanically create an asmx/WCF layer around it.
  5. For some simple, peripheral things like management tables used internally or perishable features I might even do 2-tier, using SQLDataSource on the forms/pages. A component package such as DevExpress rocks in that scenario (and is beeeeaaaaaaauuuuutiful, makes you look great).
May 25

Update on IE 8 Beta - I Like it

My first impressions on IE8 Beta (http://maurosjungle.spaces.live.com/blog/cns!F3CEB0849B03B6CC!356.entry) still stand, but after using it for more than two months I do have some comments.
 
I am quite happy with IE8, especially because it Is stable, fast and does not have my #1 IE 7 annoyance. IE7 doesn’t allow you to open more than about 30 pages at the same time (YMMV, but 40 pages is really a dead end). This is the way I browse the Internet and my browser should be able to do support it, period. Actually when you open that many pages on IE7, you cannot open any new windows at all in any program, not even the system menu when you right click on something. IE7 is actually hogging some system wide limit (very strange, BTW).
 
That IE7 hogs so many system resources in a computer with 3 GB RAM is beyond inexcusable. That reminds me of Windows 3.0 times when there were some limits on the amount of stuff you could do because of the use of a single 64kb heap for some system data such as Windows management data. Windows 3.1 improved that by using different heaps for different kinds of data but Windows 95 with its true 32-bit architecture is supposed to have put those limits to rest.
 
IE8 is fast and compatible with most sites. It has an “Emulate IE7” button that supposedly emulates IE7 behavior. I usually leave this “Emulate IE7” turned on because without it some sites don’t display properly. Also, since it’s a global setting (why?) and you have to restart all copies of IE in order for this setting to “stick”, it’s simply too much trouble for me to do this all the time, especially with dozens of simultaneously open windows. I say “supposedly” emulates IE7 because Google Maps is unusable even with this setting on.
 
So except for this Google Maps issue (I then open Firefox), I like IE8 Beta better than IE7 retail.
May 22

My DevTeach sessions on SharePoint

As promised, the presentation and samples from my SharePoint sessions are now available. You can download them from DevTeach’s site at http://www.devteach.com.
May 21

Microsoft to support ODF and PDF in Office 2007 SP2

Microsoft announced today that it will support ODF and PDF “out of the box” in the next Service Pack of Office 2007, which used OpenXML by default (http://www.microsoft.com/Presspass/press/2008/may08/05-21ExpandedFormatsPR.mspx).
 
Microsoft fought bitterly against IBM, Sun and Open Source supporters in the international standard bodies for OpenXML approval, which finally became an ISO standard a month ago. This comes as a surprise move and shows that Microsoft is putting its money when its mouth is. Microsoft always claimed that OpenXML was superior and that people must have options. Now it’s indeed relying in the superiority of OpenXML, since being shipped with the major productivity suite (Office itself) is no longer a barrier against ODF.
 
OpenXML has full compatibility with all the billions of Office documents out there. ODF is simpler but is less capable and isn’t fully compatible with Office documents. Maybe there’s even space for both formats – but I wouldn’t hold my breath: OpenXML is very capable and free; if I were to write software to create Office documents I would place my bets on OpenXML – there’s no downside.
May 16

DevTeach session on Exceptions

This week I delivered three sessions at DevTeach in Toronto, Canada (http://www.devteach.com/). As promised, here is the slides and examples from the “Exceptions: The good, the Bad and the Ugly (NET374)” session: http://www.mas.com.br/blog/ExceptionsDevTeach.zip
 
This session consists of the rationale behind exception and clear guidance on how to code properly. There’s probably something there even for the people that didn’t attend my session.
 
I will post the SharePoint sessions as soon as I get back home and open the virtual machine.
 
You can read the full interview I did with Anders Hejlsberg mentioned at my presentation here: http://maurosjungle.spaces.live.com/blog/cns!F3CEB0849B03B6CC!270.entry
View more entries
 
Updated 3/6/2008
Updated 4/1/2008
Updated 2/23/2006