Welcome to GASP Sign in | Join | Help

Hugo Batista

<wsa:RelatesTo>
Software Engineering
</wsa:RelatesTo>

News


  • All information or content in this site is provided "AS IS" with no warranties, and confer no rights. The views expressed by me do not necessarily reflect the official policy, position, or opinions of the company where I work.





DevDays09 – WIN406 – Dependency Injection with Enterprise Library 4.1 – Attendees Resources

I would like to thank all who attended WIN406 – Dependency Injection with Enterprise Library 4.1. I hope your time in the session was worth the investment.

If I’ve been successful, you already downloaded Unity and can’t wait to use it on your current project, right?! :) For me it has been a wonderful experience to have the opportunity to talk to a so distinctive audience, and see a growing interest on Enterprise Library and Dependency Injection in general. It was really nice to see that Dependency Injection is becoming popular and popular each day!

For those who attended the session, demos and slide decks are available in my skydrive.
If you want to run the demos, I would recommend you first read the demo script.

Here are also some quick and useful resources about Unity and DI in general, so you can start today:

1.    Download Enterprise Library and related resources: http://msdn.microsoft.com/entlib
2.    Join the Enterprise Library and Unity communities: http://codeplex.com/entlib and http://codeplex.com/unity
3.    Navigate Unity Documentation http://msdn.microsoft.com/unity
4.    Browse Microsoft patterns & practices catalog http://msdn.microsoft.com/practices
5.    Read more about Dependency Injection Design Pattern http://martinfowler.com/articles/injection.html

[crossposted from http://blogs.msdn.com/hugobatista]
Unity 1.2 and PIAB: Creating a Unity Extension that auto configures the container with PIAB policies

Following my last post around Unity and PIAB, and as already mentioned, PIAB policies have to be explicitly applied to a Unity Container.

But what about if you want to apply always the PIAB policies to your container? Easy, apply an extension that does that for you:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration;

namespace MyExtensions
{
    public class PolicyInjectionInterceptionExtension: Microsoft.Practices.Unity.InterceptionExtension.Interception
    {
        protected override void Initialize()
        {
            base.Initialize();

            // Get the PIAB config out of entlib config
            var configSource = ConfigurationSourceFactory.Create();
            var section = (PolicyInjectionSettings)configSource.GetSection(PolicyInjectionSettings.SectionName);
            // Apply PIAB settings, if any, to the container
            if (section != null)
            {
                section.ConfigureContainer(this.Container, configSource);
            }

        }

    }
}

 

So, instead of adding the standard Microsoft.Practices.Unity.InterceptionExtension.Interception extension, you can add MyExtensions.PolicyInjectionInterceptionExtension which auto configures the container for you.

Pretty easy, right?

[crossposted from http://blogs.msdn.com/hugobatista]
Unity 1.2 and PIAB: How to configure the container with the PIAB policies

Here’s a common question that normally arises when you start to use the new Unity 1.2 interception with PIAB.

Common Facts:

  1. You are using Unity 1.2
  2. You added the new Microsoft.Practices.Unity.InterceptionExtension.Interception to Unity
  3. You configured some policies in PIAB
    1. ex: Cache for some namespace

Problem:

  • The Policies don’t get applied and PIAB call handlers don’t get fired

Cause and Resolution:

Because you didn’t applied the policies to the container, and that has to be explicit.

And how to it? here’s a simple example:

// Get the PIAB config out of entlib config
var configSource = ConfigurationSourceFactory.Create();
var section = (PolicyInjectionSettings)configSource.GetSection(PolicyInjectionSettings.SectionName);
// Apply PIAB settings, if any, to the container
if (section != null)
{
    section.ConfigureContainer(container, configSource); 
}

So, we have to get the configuration section, and apply it to the current container. To do so, the PolicyInjectionSettings now exposes a method “ConfigureContainer” which accepts the container to configure.

Other things to be aware

Also beware that Unity 1.2 has refactored some classes that you might be using in the past if you were integrating Unity and PIAB:

  • ICallHandler is no longer a PIAB interface, it is a Unity one. PIAB handlers were refactored to implement this one;
  • TransparentProxyInterceptor is now on Unity (Microsoft.Practices.Unity.Interception). You also have more interception alternatives like InterfaceInterceptor and VirtualMethodInterceptor

Next post I’ll show how to write a Unity Extension to do this container configuration.

[crossposted from http://blogs.msdn.com/hugobatista]
Enterprise Library 4.1 and Unity 1.2 are out!

The P&P team just release a bunch of changes on EntLib 4 and Unity. Finally, PIAB is now integrated with Unity! Check out at:

Enterprise Library 4.1 - October 2008

Unity Application Block 1.2 - October 2008

Soon, I’ll try to post some impressions about this Unity release…

[crossposted from http://blogs.msdn.com/hugobatista]
Leaving Google and returning to Microsoft

Sergey Solyanik left Google and is back to Microsoft. His post on the subject is just... hum.. pragmatic! Here are my favorite parts of the post: (bold format is my responsibility)

(...) "First, I love multiple aspects of the software development process. I like engineering, but I love the business aspects no less. I can't write code for the sake of the technology alone - I need to know that the code is useful for others, and the only way to measure the usefulness is by the amount of money that the people are willing to part with to have access to my work.
Sorry open source fanatics, your world is not for me!
"(...)

(...)"On the other hand, I was using Google software - a lot of it - in the last year, and slick as it is, there's just too much of it that is regularly broken. It seems like every week 10% of all the features are broken in one or the other browser. And it's a different 10% every week - the old bugs are getting fixed, the new ones introduced. This across Blogger, Gmail, Google Docs, Maps, and more.
This is probably fine for free software, but I always laugh when people tell me that Google Docs is viable competition to Microsoft Office. If it is, that is only true for the occasional users who would not buy Office anyway. Google as an organization is not geared - culturally - to delivering enterprise class reliability to its user applications.

The culture part is very important here - you can spend more time fixing bugs, you can introduce processes to improve things, but it is very, very hard to change the culture. And the culture at Google values "coolness" tremendously, and the quality of service not as much. At least in the places where I worked" (...)

And with that said, we can continue to run business as usual. Back to work!

[crossposted from http://blogs.msdn.com/hugobatista]
Unity 1.0 released!

Unity is out. Check out the official release page at msdn.

I'm testing the final bits and in the next few days I'll post my thoughts about it... stay tuned!

[crossposted from http://blogs.msdn.com/hugobatista]
Now on MSDN...

This blog is now cross posting some content on MSDN....

[crossposted from http://blogs.msdn.com/hugobatista]
Techdays Portugal 2008 - DEV09 - Life at Microsoft - The truth revealed

For those who attended DEV09 and asked me the video source:

Life At Microsoft - The Truth Revealed

 

And for those who didn't understand why the video at the beginning of the session.. well.. it was just a teaser so I could get the audience's attention! :)

Unity release postponed

According to Grigori, the RTM version of Unity has been postponed to April 7, rather than March 15 (Well.. i guess everybody was already noticing that there wasn't any release at March 15, right?)

 

Meanwhile, the last weekly drop is still the March 12 one.

Techdays Portugal 2008 - DEV09 - Slides finais, demos e comentários.

Para quem se deu ao trabalho de assistir à minha sessão, os slides finais, bem como as demos, estão disponíveis na minha Skydrive. Chamo a atenção que as demos estão compiladas para a weekly drop de 12 de Março do Unity. Brevemente, e assim que tiver notícias da RTM, colocarei uma versão final actualizada para a mesma.

As mudanças dos últimos dois anos têm-me deixado um pouco mais longe da comunidade do que pretendia, e por isso o Techdays permitiu-me voltar de novo ao activo. Foi mesmo muito interessante ter participado no evento, apesar de as últimas semanas terem sido extremamente exigentes. 1 hora de apresentação demora muitos dias de preparação, por mais que dominemos o tema. Uff....
Fiquei positivamente impressionado com algumas trocas de impressões com alguns dos participantes no final do evento. Há gente por aí a fazer coisas muito interessantes! É sempre gratificante poder partilhar com uma audiência tão interessante.

Uma nota final aos comentários, especialmente para agradecer algumas palavras de apreço. WOW! Não estava à espera de um feedback tão positivo! Espero que seja contagiante à utilização da pattern. Por outro lado, alguns comentários sugeriram que os próximos eventos dêm uma maior cobertura a patterns... vou pingar a organização sobre isto. ;)

Miguel Madeira @ Gasp Bloggers

Miguel, a GASP fellow, finally migrated his blog to the Gasp website. Please welcome Miguel and check his feed!

Live Maps Bird's Eye last update at Portugal

WOW

birdeye

Now we're talking!

EntLib4 and Unity Roadmap

It's public!

Unity 1.0 RTM: 15th March (Next day to Portuguese Techdays Unity Demo: http://www.techdays.pt/session/2008/dev09.aspx)

EntLib 4 CTP: 15th March (Application blocks integration with Unity still not provided, but Object Builder 2.0 will be available)

EntLib 4 RTM: somewhere in mid-end April (including Application Blocks integration with Unity)

Stay tuned!

Techdays 2008 - Eu vou lá estar!

Faltam 3 semanas para o evento mais esperado de IT em Portugal.

Este ano estou responsável por apresentar a mais recente versão da Enterprise Library, nomeadamente o Unity, a framework de Dependency Injection que vai revolucionar a Enterprise Library!

Unity Feb CTP is out!!!

Finally, the so expected EntLib Dependency Injection implementation is out.

Dependency Injection is, IMHO, the most important design pattern on extensible software design. But unfortunately, Enterprise Library previously lacked the support of a lightweight Dependency Container, even if Object Builder was trying to provide this. My view is that OB was to low-level for day-to-day use.

Finally, the Unity Team provided a lightweight container for EntLib and assembled a couple of contributions to OB (and I think some community opinions)

Can't wait to post details on my test-drive. I also expect to be delivering a community session on Unity on the next weeks.. so keep tuned for more news!

More Posts Next page »