October 2007 - Posts

Hello everybody! I spent the last few hours to find out more about CascadingDropDown (CDD)  and I really didn't like what it really is.

The main question.

The requirements to make your CDD to work are just:

  1. NEED to use a web service (arghhhhhhhh);
  2. Write the method inside your ASPX page (code behind is a bad choice hun?)
  3. Need to learn how to pass values to and from the CascadingDropDownNameValue collection.

That's for me is a really bad thing. The one thing that CDD really does that's very nice is the automatic behavior handling of the parent's and children's DropDownLists. If there is no item selected on the parent DropDown, the children are automatic disabled and when you select a new one the children goes thru a two state os exibition, telling you to wait and when the requisition is over, tell toy to pick your choice.

I really didn't like it, as I said in the beginning and I intend to use the "normal" approach:

Yes, you may think that I'm a really bad guy, but in my case CDD doesn't help me on anything. I hope that someone else can find it usefull.

See you!@!

Chilá!@!

Well, here I am talking about ASP.NET AJAX again... This subject is so great that I could spend hours and hours on it, but let me say my first impression about it. I'm running my tests in a very slow machine with only VS2008 Beta 2, so quickless wouldn't be a problem hun? NO!!!!! I was surprised to see ASP.NET AJAX on action.

It's really lightweight, easy to learn and easy to deploy too!

I already coded AJAX on hand, handling the posts, creating the XMLHTTPRequest object and so on... you may think that I'm crazy, but I'll give you this tip, do it by yourself, one, two, ten times and you'll have an idea of how great is the work of the people that build AJAX Frameworks.

Back to ASP.NET AJAX, I'm very pleased to see that it's so easy that even ME (:P) can start coding without problems. The online documentation is great as is the software.

UpdatePanel and UpdateProgress are great and really can save your time as well. If you already tried it, you know what am I talking about but if you don't, download it and see it in action. It's amazing.

Well, on the next posts I'll start to put some code about my ASP.NET AJAX experience, so, came back to see it!!

See ya!@!

Chilá!@!

I heard a lot of developers saying that they will move some function to AJAX, that's better, quick, WEB 2.0 etc etc. But one thing we must keep in mind before deciding is where I'll really have benefits moving to AJAX?

I usually point somethings to my friends about AJAX adoption. You'll really improve your system and your user experience if:

  • The function does not infer on the rest of the page, for an example, loading a list of cities based on the selected State.
  • Business rules checking. Why let the user post the data if you could know before the post that something's wrong? This will help users bandwidth and experience as well.
  • Dynamic bahavior of the page based on user input. Again, the same reason of the above item.
  • Large page post backs. If for any reason, you got a really large page, you should think about moving the persistence to AJAX. I say this because of an issue me and one friend found. The large page, causes a large post and just the post back, without any persistence method was very slow. When we moved the persistence to AJAX, the performance was incredible!

As you can see it's not always that you will really improve your system quality, performance and user experience. But you must be aware of just move on AJAX for move. If there isn't a such good reason, then the move will be a waste of time and resources.

Did you improve your application with AJAX? Do you think it was a correct or a mistake move? Tell me, leave your comment!

See ya.

Chilá!@!

I have seen a lot of talk about Microsoft's new product, Silverlight. First of all, its name is a very funny joke with Flash. Have you ever thought which color is the light os your camera's flash?? Well, when you take a picture, a silver light just blink to make it all clear on the pic, funny, isn't it? So is Silverlight a real adversary of flash?

If I have to bet, I would put my coins on Silverlight. The integration with .NET  Framework will just make things easy. Have you ever tried to write a flash animation with some logic on it? If so you know that you have to lear the flash's native script language. OK, learning something it's not so bad, but if you can write the same thing with a language you know and often use.

I'll write somethings using Silverlight on the next days and when I'll post here my first impressions but, as far I know, it's an amazing product and its integration with XAML will just make things easier for us!

Tell me what's your opinion about Microsoft Silverlight.

That's all...

See ya!@!

Scott Guthrie, posted today that on Visual Studio 2008 we will be able to debug inside .NET Framework base class libraries. This will be possible, because the .NET Framework 3.5 will be delivered with source code. This is a great big feature that will help developers to debug inside a .NET Framework Class.

I'm not sure if that will be such a great thing or not, I usually debug my applications to find some errors on it and not to find some errors on the Framework, but, let's see where and when we can use this. For curiosity purposes that's great, but, for the day-by-day work I don't see a clear use of the .NET Framework source code.

Click here and read the full Scott post! 

See ya!@!

Chilá

Today we will talk about the Enterprise Library (EntLib). I won't cover here that on version X you could that thing this way or that on version Y you would do this way. I'm just going to explain how does it can help us to improve our produtivity and get a better coding experience among the team's developers.

How to deliver a great solution?

When I'm asked of how much we will better when using EntLib I usually say that it'll get better, but how much will depends on your developers. That's right, how many times you give a developer a powerfull tool and the solution produced is so poor that you become shame or how often you produce great softwares that you thought wasn't possible with 'the version' you got? EntLib is a great step ahead to improve the quality and produtivity of a team, but you need to open up your mind to accept the new concepts you'll have to follow, new commands and sometimes new words too!

What's EntLib?

EntLib is a set of classes that were built to avoid that you, developer, have to write the same portion of code everytime to do the same. As usually, I'll start giving the example of Database connection. How many times you needed to do the following:

  1. Declare connection, command and parameters variables?
  2. Build or discover the connection string to connect to a database?
  3. Read appsettings to return the values of a connection string?
  4. Open a connection?
  5. Execute some command?
  6. Get the return of the execution?

As you can see, it's always the samething and you can use EntLib to avoid this kind of repetition.

Data Access Application Block - DAAB

The first EntLib block you might be curious to see is Data Access for sure. This happens because we always need Data Access on our applications and we always need to do the same thing to accomplish the task.

For teams, the benefits of using EntLib are huge! Just for an example, the lead developer can set up all the connections strings, store them on a config file on SourceSafe or any other source control software and then all the team will have access to that configuration.

Think about another great application block, called Exception Handling Application Block (EHAB). You can config EHAB to work with DAAB, handling some data access errors that can occurr and log the errors on a file, Event Viewer or just send an email with the error.

Now, let's show how you can begin your work with EntLib.

First of all, click here and download the May 2007 version of EntLib. After the installation, just run EntLib, you will see something like this:

image

Everything begins here. Just right click on Enterprise Library Configuration on the left panel, and the choose 'New Application'. Again, you will see something like the follow:

image

For this small first example and touch with EntLib, again, right click on 'Application Configuration' on the left panel and the choose 'New | Data Access Application Block'. For the DAAB work, we need to set up the connection strings we want, giving them names and properties.

Now, the structure that you will se on the left panel is like this:

 

Bellow the node 'Connetion Strings' you can add how many connections you want, giving name as well,setting up the way you want and with the provider you need. I'll not show any example of connection string here, but if you have any problem, please tell me.

After setting up the connections string you might be curious to see EntLib in action. Well to do that, you can now save the application you created and close Enterprise Library Configuration. You will start Microsoft Visual Studio, create your solution in the language you want (Visual Basic, C#). If the solution haven't a config file, add one, otherwise, just open up the existing config file. Then through Windows Explorer, locate the file you saved on 'Enterprise Library Configuration' and then copy it's contents to your config file. On web.config, paste it inside configuration tag.

Now the final act, consumig the EntLib. Just do the following:

  1. Add a reference to 'Enterprise Library Shared Library';
  2. Add a reference to 'Enterprise Library Data Access Application Block'.
  3. On your code add the import/using reference to 'Microsoft.Practices.EnterpriseLibrary.Data'
  4. Then just paste the code below on the desired method:

image 

On the code above "northwind" is the name of the connection string on EntLib config File.

Just run the application and you will se EntLib in action.

Conclusion

EntLib is a great support base to help on creating next level applications. Please use it as much as possible and you will se that you wonder how did you live without it until now!!

For more documentation, please see the official page of EntLib clicking here.

See ya!@!

Chilá

More Posts