Reading Notes #132

TypeScript_CoverSuggestion of the week

  • TypeScript for C# Programmers (Steve Fenton) - Great book that in less than hundred pages, explains to me how to code in TypeScript. I feel so comfortable already I will add TypeScript in my next web project, and I will strongly recommend this book to everyone. If you are a C# developer, know your base in JavaScript this book is available in PDF for free!

Cloud


Programming


Miscellaneous



Reading Notes #131

typescript1Suggestion of the week

  • Build End-to-End Apps with TypeScript (Gil Fink) - Amazing tutorial that gives the opportunity to learn a lot about recent language and tools. A mandatory reading for all web developers.

Cloud


Programming


Miscellaneous


~Frank


Reading Notes #130

Suggestion of the week


Cloud


Programming


UX


Reading Notes #129

OlympicsSuggestion of the week


Cloud


Programming


Databases


Miscellaneous

Reading Notes #128

Suggestion of the week

  • What is Windows Azure? - This post gives the definition of Azure that is short enough to be said in one breath.

Cloud

Programming

Miscellaneous



Reading Notes #127

Suggestion of the week

Cloud

Programming

Databases

Integration

  • Streaming Xml Transformations (Christos Karras) - Great tutorial that explains very clearly what are our solutions when we are in front of a complex XML transformation.

Miscellaneous


As strong as a team

cloudteamEverybody knows that we are stronger together. At work, we are grouped in small teams to accomplish more and... but wait, are we really working as one big strong force or are we working in a group but focusing on our own personal achievements? Let me share with you how as a team, we achieved what we thought was impossible.

The Context

The project was an application integrating different parts of the client's environment. A lot of technology was involved and of course, the schedule planned for it was really tight. We were a small team with different levels of experience.

The fall

As a team, we thought that splitting the job was the best option. Every member took a piece of the puzzle and started working on his side.
The juniors got themselves overwhelmed in complex patterns and best practices. They forgot the client's needs and tried to stubbornly use new technologies. The more experienced were pushed in this swirl of queries and technological challenges, lost their landmark, their concentration and the big picture.
The solution we were building was looking like an ugly patchwork that was not even functional. Continuing this way was a guarantee of failure.

The recovery

Of course, I wouldn't be writing this post if we did continue, instead we met and looked at what we could do better. Hopefully, for us, most of what we did was not a loss. If we re-focused, with a bit of a ramp-up and some extra hours put in, everything was still possible.
We did some lunch-and-learn to share the knowledge. We wrote templates to get all on the same base when we were starting new sections. We also produced short documents that explained how to get started with the concepts and technologies present in the project. The goal was to keep it short and simple so it will be readable at a glimpse.
However, all this would have been lost without code-review for everyone. Often code-reviews are perceived negatively. A review is the chance to improve not only "your" code but to standardize variable names, namespace structures, code patterns and to get to know the functions/ tools available.
Another valuable thing was our daily scrum meetings. That way, as soon as one team member had issues the best resources could jump-in to resolve the problems, or share his previous experience on how to solve this kind of complication.
With all these efforts we not only did we deliver a great solution, but we built something better: a team. Not only that people worked with each other, yet they were team-members that worked in synergy and that, is a great accomplishment.

The Lesson

I discovered something that I already know! A chain is only as strong as its weakest link. It sounds so simple but is it not always like that with the truth? Feel free to share what you did to improve your teamwork in the comment section.


~Frank

References

  • www.scrum.org

Reading Notes #126

Cloud Architecture Patterns - CoverSuggestion of the week

Books

  • Cloud Architecture Patterns (Bill Wilder) - Very instructive books that explains many different patterns with clear and practical examples. All the patterns presented are also implemented in an application Page of Photos (or PoP for short). A great book that I strongly recommend.

 

Cloud


Programming

  • Code Kata - I love it. I didn't know those kind of websides exists! I will make my visit.

Miscellaneous

~Frank


Reading Notes #125

frozenfanceSuggestion of the week

Cloud

Programming

Architecture

Miscellaneous


~Frank


Reading Notes #124

winter_pathSuggestion of the week

Cloud


Programming


Miscellaneous


Reading Notes #123

VisualStudioOnllineSuggestion of the week


Cloud


Programming

You can find out more about these conventions in the blog post Custom Code First Conventions (EF6 onwards)

Architecture


Miscellaneous


Reading Notes #122

2014Cloud

Programming

Architecture

Reading Notes #121

Reading Notes #121

Cloud

Programming

(oups, I lost my notes... sorry.)

Reading Notes #120

Suggestion of the week

Christmas Planet

Cloud


Programming


Databases


Architecture

  • Composite Pattern (Gunnar Peipman) - Good post that explains clearly a pattern with code sample.

Miscellaneous



Reading Notes #119

 

Stack of books-300

Suggestion of the week

  • BizTalk Summit 2013 Wrap-up (Kent Weare) - Very important news from the integration world. This post is a very complete summary of the event. Good job.

 

Cloud


Databases

 

Programming

Miscellaneous


~Frank


Reading Notes #118

NodeJSSuggestion of the week

Cloud

Programming

Miscellaneous


~Frank


Reading Notes #117

2013-11-24_2213Suggestion of the week


Cloud


Programming


Miscellaneous




Reading Notes #116

 

SomethingIsCommingCloud

Programming

Channel 9 has an excellent streaming video that covers Code Maps here 

Databases

Miscellaneous

~Frank

Reading Notes #115

Moustache-Glasses-2_originalSuggestion of the week

Cloud

Databases

  • WebLog of Ken Cox - I find out that using the migration wazard was the best option in my case... Until they update Sql Management Studio.

UX

Programming

Miscellaneous


~Frank


Localization from url with Asp.Net MVC 4



To offer a website in multiple languages using ASP.Net we simply need to add some resource.resx files to our project and voilĂ . Based on the language of the browser, IIS will match the localization resource. However, what if we want to give the choice to the user?

The goal

One pattern often used to achieve this, is to split the resource based on the URL.

Ex:
http://www.DomainName.com/EN/About for the English path
http://www.DomainName.com/FR/About for the French path

The needs

We will need something to grab the desired language from the URL and set it as the current language.

The Solution

First, let's add a new route. Asp.Net uses routing to parse the URL and to extract information from it, while keeping the displayed URL more user friendly. The default route is {controller}/{action}/{id}. So without a new route, our language will be treated as a Controller name; but that’s no good.
The route we want is {lang}/{controller}/{action}/{id}. We could just replace the default, but then what would happen to "normal" calls?

The best thing to do is to add our localized route first and keep the default second. The way the routing works, it will use the first route that matches. Since we will use the two-letter code for chosen language, lets add the first part {lang}, which must be two characters long to be considered valid. You can see this in the code where I define a constraint using the following Regex: "^[a-zA-Z]{2}$".

Class_RouteConfig
Now that we have the language, we must change the user interface culture of the current thread. I decided to use an Attribute, making it easy to use. Under the Filter folder add a new class which inherits from ActionFilterAttribute. This method will check if "lang" is available from RouteData. If lang is present it will change the currentUICulture of the current thread. If "lang" is not part of the URL, then it will set it to the default.

Class_LocalizationAttribute

We could put the [Localization] attribute on all controller classes, but a best practice is to create a BaseController class and use it there.

Class_BaseController

VoilĂ , you can now change the language of the entire website by changing the URL.

Bonus: Use it everywhere


To use it in the view and the controller it's easy; just add the namespace and just type Resources.NameOfYourResourceString.
To use it in the validation and the generated code from the model, we could use something like this:

Class_PersonModel

This way, in the view, the code will still stay clean and simple.

@Html.LabelFor(model.UserName)

I hope this post helps you in your development efforts. Any comments, suggestions and/or questions are welcome.
 

~Frank