Friday, 3 July 2009

Post conference & After Thoughts

This is sort of a rushed post as I am leaving on long vacation for the first time in many years. So you will not hear from me in a month (as it it was the first time and you minded :-p)

Post-Conference

I changed my mind a couple of weeks before the conference to go to Julia Lerman's session about Entity Framework.

As I have said before I like her style a lot and she is as knowledgeable about the subject as the bests but, more importantly, she is honest about the product. She knows the weak points and investigates to find solutions. Besides I need to know. I need to know what makes it such a hated product amongst the Alt.Net crowd. And, let's face, in some clients, it would be the closest option to an ORM one could touch.

I enjoyed it a lot. She is great at communicating how it works and why it was thought like that, the reasoning that the product team revealed her. My opinion for the product? You are not going to have it here and now.

Besides I was lucky enough to win her book on the subject!! Thanks Julia!

Final Thoughts

What a conference it has been. To be honest, I think I have enjoyed it more this year than the former.

Thinking about it, I had way too great expectations for last year's and some of the names disappointed me a bit (not that they were bad, just that my foolish mind thought they were going to come down from heavenly skies riding a bolt) but this year my expectations were more down-to-earth, so that they were more than fulfilled.

I attended a lot of Silverlight sessions, which attracts me, but I am not crazy about it either. Mostly because of my fear for XAML. Not for itself but for its complexity and the roughness of tooling.

I did a lot of DDD. This one topic I am more crazy about. I try to apply as many ideas from "the movement", but the domain and the tools I am using in my day-to-day work do not lend themselves to that school of thinking.

I am looking forward to seeing Oslo grow up. I also need to invest some time on dynamic languages and recover some grammar theory knowledge from college days.

Entity Framework has a place in my schedule of technologies to play around with. But it will be when the next version is released. Then I am ready for it.

It is awesome being surrounded by so many talented and passionate people. But it makes you feel small and "un-smart". It reminds you of how long the way is ahead of you. One has two options: being brought down, or encourage oneself to become a better professional and let the people know.
I, for one, choose the later.

 

Happy holidays

Tuesday, 30 June 2009

Dev Teach 2009 - Day 3

Last day of the conference (I still attended the post-conference). My brain was still operative after 3 days of squeezing it, and what a way of pushing it on for another day!!

BDD Installed

As I mentioned before I am becoming a testing junkie and I am starting to be attracted to something stronger than "simple" TDD.

I consider David Laribee a very good speaker, very capable and reflexive but I also consider his talks a bit esoteric and abstract. Being this talk no exception to my considerations.

I still have to "play" more and do some real work with BDD to buy all the goodness David promised to us. I liked the graphics of "Difficulty of Adoption" vs. "Investment Return" but I am still skeptic on the amount of value it brings to the table once you have a solid TDD (even TDDish) process in place.

I liked his ideas of ping-pong working style to get the acceptance from the team. I am still looking for the techniques to sell it to management and the clients themselves, although the old-but-not-always-successful "do but not tell" is always an option (I actually did not say this ;-p).

Overview of Oslo

If the session about DSLs from the previous day left me wanting for more Oslo, this session was just mind-blowing. Apparently, the original speaker was unable to deliver the talk and Douglas Purdy was sent to replace him. No one will know how would the talk have been, but I have to tell that it would have been hard to improve this talk.

The speaker is from Microsoft and, as I noted before, they have a different way to deliver information. And here I have to stress that "different" is not a different word for "worse".

The session did not started well. "OMG here we go with another sales pitch and a grand-vision-product". But this changed dramatically when he started to show the tools and explain examples and "poison" our malleable minds with the possibilities of the product.

He demo-ed how to define a model using M. How to consume this model with text-based and visual tools. How to create a simple DSL to interact with our model (insert entity instances).

By this time I was drooling and I wanted to marry him (platonic marriage) when he told us that in the next version we would see how our models and DSLs can be consumed and used by .Net applications.

Once married, I wanted his DNA (platonic DNA) for my descendants, when he demo-ed how to convert assemblies into models and perform complex querying using either M or plain-old TSQL.

Yes, I am aware we already have a kick-ass tool with NDepend and CQL that provides awesome capabilities for analysis and querying of code. But I was bought it with the promises of integration of those models with another model-enabled applications.

He even showed how to import UML diagrams into an Oslo repository from Eclipse!!!! Eclipse! Did you hear that? Eclipse! Times are A-Changing

Architecting Silverlight Applications

Boy, was I fired-up after the Oslo session. And the next session did not disappoint me in any way. Darcy delivered a very sound session and showed great deal of experience and knowledge on the subject when audience asked to be more explicit on the strong/weak points of Silverlight against other architectural alternatives for the presentation layer.

It was a session on considerations that we have to take into at different levels when we evaluate the fitness of Silverlight as the chosen technology for the forthcoming application. The session was completed with small knowledge pearls (from the attendants also), announcements of new capabilities for tools and bunch of answers to practical questions from the audience.

Very satisfying.

Unleash Your Domain

A very, very nice talk on "revolutionary" techniques for DDD goodness with, yet again, no concrete implementations.

I have to digest the wacky ideas the speaker threw at the audience. I am not going to say I picked up everything but I was not alone (some attendants acknowledged that in public, how brave and cool is that, huh?)

Even so the session provided me with a lot of mind-fodder: weird message-based domain models and ultimate Command/Query Separation with completely segregated models.

Customizing the Entity Data Model

No I am not a quitter. I still think that Entity Framework is still not there. But I still want to understand first-hand why in detail. The fact that I planed to attend Julia's full-day on the subject and she becoming one of my speaking-favorites from the last edition led me to this room.

And, as always, she delivers. She is really passionate with the subject and knows how to present cold facts with no trace of evangelism.

The session was full of code and practical information (which kept me happy) about the work one can do with the classes generated out of a "fixed" data model. Entity splitting, conditional mapping, inheritance and a preview of complex types coming in the next version of the framework, filled our time joyfully.

Building and Application with Oslo

Last session. And what is better than close the deal with your blue prince from several hours ago?

But you know how transient love is, mostly teenage love ("we better split before one goes to jail or gets seriously broken-hearted").

We badly broke because one of the parts was not ready and, not finger-pointing here, it was him. Well, his... thing. Oslo is just not there yet.

My mind was drifting away with the possibilities of Oslo and DSLs, and consuming them from .Net programs when I was sent back to earth badly as the speaker (Douglas again) was showing the complexity and the annoyance that the process it is right now (duplication of model classes, slightly cumbersome API, etc...)

Oslo (Doug), listen to me. I still like you, but... I have to go on with my day-to-day and you are still not ready to bring happiness to my days. Give me a ring when you are a grown-up. I have lots of plans for us two.

Plays of the Day

Wow, what a last day of conference:

  • "Reificated"-love in standby with Oslo
  • Now I know more when Silverlight can be of use to me
  • DDD fantasies and data partitioning dreams. Data consistency, you do not know how they hate you. Yes, you and that 2-phase-commit friend of yours
  • A first-bite of the Entity Framework cake

Friday, 26 June 2009

Dev Teach 2009 - Day 2

Sleeping like a baby but still being excited enough to wake up earlier is one of the greatest feelings that I experience in this sort of conferences. That and not having to vacuum-clean the floor for a whole week. Aaah, those little pleasures in live...

Introduction To MEF

My intention attending this talk was to answer the questions:

  • "Is it an IOC container?"
  • "Is it another reincarnation of ObjectBuilder?"
  • "Is it a plane or would it just brew some coffee for me?"

And I got pretty much all of them answered, which, for me, is enough to put a tick in the square "Productive Talk" (the coffee question was a No, but I see an open-source contrib-style project coming :-p).

A bit of a set back was that the chances of the team dropping the coolest feature (on-the-fly load of parts) are very high. Oh, that and the framework not offering any facilities for assembly unloading, apart from us developers managing our owns AppDomains. Still, a technology worth considering when the need arises.

Curiosity: amazing how "blue-badge" speakers can be distinguished from those who are not, even if they do not mention their employer.

A Lap Around Silverlight Toolkit

Another Microsofty and another fast-talker. And a very nice session.

It provided everything that was announced and the speaker was was very effective and energetic (once he loosened up).

Perfect session for someone with my knowledge on the subject: a live run-though most common controls that can be used in Silverlight, and, as it was coded literally in front of us, it provided the chance to show some tricks and reveal how "green" the tools provided by Visual Studio are.

DSLs and LOP

I had another Silverlight talk scheduled, but unfortunately was canceled, so I headed towards this one.

I am no expert in language design but I can recognize the value of a well designed and focused language to solve a concrete problem.

Too bad that F# is not one of my strong points either as the speaker showed some cool things that can be achieved with this language.

It also showed a bit of Oslo. Enough to keep my interest high for the upcoming sessions next day.

Even though it was on the Architecture track I missed some coding examples on how to create effective fluent interfaces, for instance (even though I have to admit it was not the purpose of the session).

Agreeing to Agree. DbC and TDD

Hot topic for my liking and I was not disappointed, although it was very high level with no concrete code.

Nonetheless it provided me with a lot of useful information that I can (and will) use as material for my upcoming talk on the subject. I hope it will trick my audience by making me look as if I know what I am talking about :-p

Apart from the core content of the talk (rounded-up with beautiful analogies) there were a lot of very interesting questions which turned a very interesting session into one of my favorites.

Confidence in Software Development

I knew for sure I was not going to see any code in this one but I attended for several reasons:

  • I am not only a code monkey (I use Outlook too :-p)
  • Last year I missed one of Donald's sessions and I am a regular reader of his blog.
  • I like what I read in his papers so I must like what he speaks, mustn't I?

Last "reason" is not always true, but it is in this particular case. He was very entertaining and although the session started kind of slow for my taste, it got better and better with the time.

He started adding more and more personal anecdotes and real cases that made all the attendance nod all at once while smiling with a "that is exactly what I am going through" sentiment.

In the end is about confidence: SOLID (with a big S), clean and intention-revealing code, good unit tests, continuous integration, no project management bullshit and a "can-do" attitude can make a difference. And will make a difference.

Top 10 Umbrellas

This is probably one of the weakest sessions I have attended. But to be honest, there were not many other interesting options.

Not that it was bad or anything, but the subject itself was not as promising as some other session and the speaker did not make it any more interesting (too much time spent explaining extension methods for a session that level).

I had already had a peek into this library and "borrowed" and modified/completed some of the utilities for my tool-belt-library but there were some parts of the project's architecture that were a bit esoteric and I wanted to know more.

Fortunately enough that is what I took away from the talk, a couple of ideas that will be implemented in my library: a provider architecture and some extension points to better organize my extensions.

 

Take-Aways and Highlights

Starting to "get" MEF, my growing interest in Oslo and the two great talk of the days about contracts and confidence in development.

You can recognize a common complaint of mine for several of the sessions, regarding the lack of code examples and more concrete information. so I am starting to think it is unrealistic of me to always expect coding sessions

Thursday, 18 June 2009

Dev Teach 2009 - Day 1

Keynote

Boy, do the organizers know how to choose the guys speaking at the keynote.

Not only Tim Huckaby (not a great technical blog, though) was extremely amusing and has a great background, but he also did a superb job to sell how great applications his company develops.

Not a lot of Visual Studio 2010 (but enough to include a demo effect in the reincarnation of naughty projector to show-off Beth Massi's savoir-faire) but a lot of WPF coolness. Including some amazing-looking applications for Surface. THAT is pure coolness, but do not expect a lot of clients paying the big bucks it costs.

Domain.Driven Design Chalk-Talk

And only now, I know what a chalk-talk is :-) And I like it. But let me tell you it does not mean practical talk.

Some information about anti-patterns never goes wrong. Some further clarification for concepts in "The Blue Book" are always a winner too.

Very, very interesting talk, even no line of code or technology-specific technique  was displayed.

Pragmatic Architecture

Architecture, what an abstract concept when applied to computing. Sweet spot for some, almost insult for others... This was a try to clarify what it is and what it is not. And if the try comes from one of the most entertaining guys in the industry, Ted Neward, we have a recipe for success. Lots of funny stories, jokes and a message: an architect understands, reassess and explores. All within the limits of pragmatism. Oops, spoiler. Not really, you really have to be there to feel the message.

He has a loud voice. And he is not afraid to use it :-D

Challenge of Silverlight Architecture

There are people who can talk fast. And then we have Kathleen Dollard (weird site) who is not also a extension of those, but she is also full of energy and knows how to transmit it. Energy and knowledge. Even me, being a Silverlight nOOb, could understand where and why she was going the place she was going. She presented a way of architecting LOB applications which I think I will follow if I ever come to do something in Silverlight. I was extremely pleased to attend to this one talk, although the description of it wasn't the most descriptive ever.

Real World Practices with TFS SCM

Well. My company uses Team Foundation Server as a source control repository and has a continuous integration server using the same product.

We all do have a SCM right? But do we take the most it can offer to us?

That was what I was happily try to find out. And, to be honest with you, I took some other very valuable information but as the talk was a bit rushed towards the end, my major points of interest (branching strategies, do's and dont's, etc..) could not make their way in. A pity, but at last I got to understand what the heck a workspace is.

SilverLight + MVVM == Easy

Last one from a veeery long day. And coming to think of it, not a very good choice.

Do not get me wrong here. The speaker was very good and the subject was very interesting. Buuuut, it had pretty much the same content as "Challenge of Silverlight Architectures" I attended before.

I still could grasp some more nifty tricks and raise some disagreements (I still believe the viewModel -or the mapping mechanism to viewModel- has to take care of data formatting, leaving the view as dumb as it can be, just for databinding and commanding).

Besides the speaker pointed out how a long a way the platform is in terms of unit testing, which I have to definitely agree.

 

Take-Aways

Let's throw some highlights:

  • Cool-factor demo in the keynote
  • Ted Neward's amusing stories
  • Trying to catch everything that was being fired from Kathleen's mouth.
  • Get to know why we should avoid bidirectional relationships in domain modeling

 

I was hammered at the end of the day. Literally exhausted, mentally and even physically (two-odd days there but jet-lag still playing games). I forgot how demanding a conference like this is. So, no party for me: dinner and straight to bed wanting for some more goodness the next day.

Dev Teach 2009 - PreConf. Agile Development...

... with IOC container and ORMs.

Long title for the very first day. And one that gives me the thrills I must admit.

Just the speakers' names and reputation set expectations very high: James Kovacs and Ayende. The former being one of my favorite speakers in the last edition and the latter being that non-human blogger with immense knowledge and an attitude (not that they need any sort of introduction but I like classifying the world around me -pun intended-).

And those expectations were not lowered during the agenda presentation: a day in which we are going to be focused on tooling (favorite of mine) that includes: AspNet Mvc, AutoMapper, Castle, Fluent NH, Nant, NHinbernate 2.1, Linq for NHibernate, NHinernate Profiler, Castle Validator, NUnit 2.5, RhinoMocks 3.5, Tortoise Svn and Visual Svn.

Wow! I am tired of typing already. And by then my arachnid sense was buzzing big time as it looked to me that it was a bit too much. And I hate being right.

It all started sour with logistic trouble accessing the SVN repository on James' laptop, meaning that there was not going to be a coding-session for me (mostly because I do not have the TON of tooling to be showed, just a handful of them).

As an appetizer: a user story and a BDD observation. Yummy and promising, as I am starting to grow interested in that style. It is also a perfect topic for lots of side-talking, and boy do the speakers like side-talking*.

From then we moved towards a philosophical question to the attendees: should we be explicit in the (our) API design when it comes to persist to the database or should we leverage NHibernate's capabilities for persistence by reachability? Tough question, that was properly explained by the speakers, after which the latter was chosen (by them).

But then it all went blurry as a lot of database talking took place, which led to some tricky NHibernate workarounds that needed to be done in order to dodge some issues with 2nd-level cache. The explanation of which was deeper than my narrow NH knowledge could handle and got my head spinning for the rest of the time remaining speaking about the subject (and was a lot).

While trying to get my mind in shape again the funky auto-mapping feature of Fluent-NHibernate blew the roof off (not literally, but at least the feature to be shown did not work as expected). Nothing major that a "good-old mapping classes" wouldn't solve, but still another bump in the path.

Time for some integration testing using Ayende's SqlLite fixture technique. Not overly cool (starting to get picky here) as I am no fan of SqlLite as a test database, mostly because I work with Sql Server, hence Sql Server CE (with all its caveats) as the weapon of choice for the task.

After lunch, a great deal of more NHibernate pearls and ways to handle the ISession. At last an IoC container was called into the game. A bit late if you ask me, but just about time if you ask someone else ;-) Fluent registration voodoo, lots of conventions and a word of advice against singleton components, which was demonstrated with the next piece of the puzzle: a simple Asp .Net MVC controller.

We were running out of time already but they showed a very nice trick to keep people alert after lunch-break: have the attendees to explain the application they have just built. Awesome for some people as it helps fixing the concepts and drives some interesting conversations, but embarrassing for the shy guys or those who did not fully get it :-p

Some more questions followed, some talking about old screw-ups with Microsoft technologies brought the point of how old I am becoming as not many people in the room could remember some of the technologies mentioned and I could :-(

Take-Aways

It IS a great thing to hear the opinions and experiences of so talented people. Mostly because, I got some reassurance I might not be doing it all wrong and I got some new nice ideas that I might consider to implement when the chance shows itself.

Database segregation (one for OLTP and another for OLAP purposes) as a desirable target is something I've been hearing a lot lately, and they made their plea in a way that I almost buy it.

There IS a database after all. Persistence Ignorance can't be fully achieved (at least with NHibernate although it makes a hell of a good job) as there are leaks here and there.

I found room for disappointment too, since the goals were a little too ambitious and we did not get to use some of the tools and techniques I was hoping we could see (object-to-object mapping, validation,...). Whereas it got pretty deep in some other areas (mostly around NHibernate and databases). Agendas are there to be changed :-)

Overall, a terrific way to start the conference.

 

* Side-Talk: being a non-native speaker I love making new terms up to enrich the language. By "Side-talk" I mean to speak about things loosely related to the main topic of the conversation.

Monday, 8 June 2009

Back to Back... DevTeach

Yes, I am on my way already to the 2009 Edition of DevTeach. I enjoyed so much last year and the agenda looked so promising that I decided to come back, and the fact that is held in Vancouver makes it even more appalling to me as I have not been to this city before.

I am getting there "earlier" for a couple of reasons:

  • not being hit so hard by the jet-lag during the first day
  • doing a bit of sightseeing as my parents popped-by to be around with me

Traveling, British Columbia and sightseeing went very well so far and I am about to start the Pre-conference with James Kovacs and Ayende on Agile Development with IOCs and ORMs.

Wicked!!!

Sunday, 31 May 2009

S.O.L.I.D Principles in the Wild

I just hope no one denies the great value of following these principles.

I am a great believer that by simply observing them every now and then, the quality of the code you create can improve by several orders of magnitude.

I also tried to do my part and spread the word within my company (and learn a lot in the process) and eat my own dog-food by following them in my code.

Last week, with a deadline hanging over my team's heads they proved to be invaluable (once again).

We were facing a common problem: the invocation of an operation over a number of possible receivers that do not share a common interface.

Over the table there were several design proposals and, being the deadline close, the Big, God-like, Monolithic, Cyclomaticly-ccomplex, Static and Modular-programming-like dispatcher came to our mouths.

We knew for sure that it was going to haunt us back very soon, but thinking sort-term is always an option (invoking KISS, YAGNI, and some other yadi yadi yada acronyms can make the lazy look fancy).

When I was about to implement the feature I could not help feeling dirty. A traitor to my preaches. A filthy programmer. A... ok, enough, you get it.

I took the risk. Educated risk. Controlled risk. The risk of doing what I felt it is the right way instead of the deadline-influence decision.

One Step At A Time

I started small. A simple spike, that can be easily rolled-back and substituted for a working thing. In order to do that substitution you need encapsulation. Since I was creating a dispatcher, a lousy dispatcher, a thousand-times, thousand-flavors classic dispatcher I separated the logic that dispatch the call from the logic to perform the operation. Simple SRSP application.

Divide and Conquer

Once they are split, responsibilities are easier to handle. But hey! the "guy" who performs the action, knows which are the conditions under which it has to execute the operation. So the conditional logic does not belong to the dispatcher, belongs to the "dispatchee". The dispatcher becomes now a simple registry, a chain of responsibility that has very simple logic: create a chain of possible dispatchers and when it has to dispatch, run over that chain and ask each member wether it is able to handle the call and delegate the execution of that call to that member of the chain.

To the last thought, follows the quick proof of concept that makes things real. And it can do it! It works! Heart pumping hard.

Present Covered, Think Ahead

Wicked!! Each dispatchee is autonomous in itself: its dependencies are injected in the constructor (DIP to the rescue), it is able to figure out when should be executed (from the context of the execution and asking its dependencies) and it also executes the operation perfectly.

And the dispatcher knows nothing of the dispatchee, just its mere existence. As a matter of fact none of the actors need to be changed if we have a new case to handle, we have also honored OCP!

Not so fast, cowboy. That is not entirely true. The dispatcher would need to be changed in order to create a new link of the chain.

Bummer! if only someone else could create that chain, the dispatcher would remain untouched and simpler to test (instantiating objects does not make a class nice to test, which smells of sub-optimal design).

A-ha! Moment

But wait! We already have a IoC Container! If only I could twist it so that it automatically could follow a simple set of conventions... Jeepers Captain! It turns out I can "teach" him to scan a given set of types and apply custom registration code when it has to.

Quick safety-net test, some googling, an odd-hour of coding. And voilá. Our dispatcher no longer has to worry about who he has to dispatch to. The container will tell him.

Reaping the Benefits

We had several places in our codebase where this pattern needed to be applied (another sign that custom dispatchers were a no-no both in terms of elegance and quick of development) and after a couple of tweaks in the overall architecture, it was a breeze to deliver the feature.

Besides, the code was very similar in terms of behavior, so I could create a test helper and make sure that we play by the rules in each concrete implementation of the case.

Furthermore, as I was implementing all the cases I could definitely see a common pattern amongst the dispatchees. Another refactoring and I had all my dispatchees implementing a base class that handled the applicability of each. Oops, tests failing. What could it be? Oh God, oh no!! Changing the structure of the classes breaks my registry. I was lucky to have tests, that would have a been a tough one to catch. Fix. Green again.

No, it is not luck, it is called good engineering practices and whoever neglects them, should have very strong arguments on his behalf. I have my experiences on mine.

Take-Aways

  • Pressure should be no argument for sloppiness. If anything, should be another argument to do the right thing.
  • Follow the principles. They are there to help you, they play in your team. Very smart guys thought of them before you, climb on their shoulders.
  • I was able to solve my client's problems using less time than following the wrong path, plus making the development (and testing) of instances of the pattern a very quick process.
  • Further changes (and we already knew some of those future requirements) can be quickly incorporated by the little framework, cutting-off development time, which will be used to deliver kick-ass useful features instead of boring plumbing hacks

 

<self-complacence />