Thursday, June 18, 2015

Loosely Coupled Applications with MassTransit and RabbitMq by Roland Guijt

One thing that is becoming abundantly clear during this conference is that SOA, CQRS, and, micro services is the new black. At the center of this you always find the service bus; MassTansit presents itself as a light weight component to fill this functionality. This is a open source project and it is available on GitHub.

This is a more practical session with examples that does not translate well into the blog posts I’m creating for this conference. I will try to express the key points of the presentation. The code that was demoed is available at GitHub.

As stated in some of the previous post there is a threshold of complexity of the application for the benefits of micros services to be useful. The usual draw backs with monoliths are presented, such as that it hard to allow teams to work in parallel.

The big difference between NServiceBus and MassTransit is that NServiceBus has more features and comes with support but costs money. MassTransit does not cost anything but has no support and lacks some features. MassTransit supports several transports such as RabbitMq and MSMQ.

Sagas in MassTransit are used for correlating services to work concurrently on incoming messages. Useful for long running processes.

This seminar was somewhat like having a blog post read out loud to you. I certainly learned some new things however I was yawning a lot while doing so.

SOLID Architecture in Slices not Layers by Jimmy Bogard

I have been a long time reader of Jimmy Bogards blog posts at Los Techies so it feels kind of awesome to see him live.

The seminar begins with a case study of a real world scenario that had become horribly complex. This leads into a discussion about the recommended n-tier structure of a system where everything is organized in layers.

By developing independent layers you run the risk of over-engineer the layers interface to ensure that the next layer has all the access points it needs. By slicing vertically through the layers and finishing each feature through all layers the interfaces area of each layer becomes exactly as big as it needs to be.

To create good separations Mr. Bogard suggest using the CQRS pattern and equates how this is similar to POST and GET for the web. To demonstrate this he digs into Microsofts ContosoUniversity example which he has re-done and is available on GitHub.

For modeling request a structure where input goes into a request handler which in turn produces output. To model these request Mr. Bogard have written a tool called MediatR which is also available on GitHub. This tool is also useful for constructing commands.

A new structure for structuring the project files is suggested where features a grouped together. Here it is suggested to create a class for the specific feature and internal classes for all needed components for that features, like commands, validators, and similar. I’m a strong believer of putting classes in their own files so I’m not so keen on this advice.

Jimmy Bogard does not take the normal approach of explaining SOLID principles where each principle is discussed separate whit a small example. Instead he dives into talking about architectural design decision with little to no reference to the SOLID principles. The actuall references comes at the end where all the architectual decisions are tied to the principles. This was a very nice way of handling SOLID.

What’s new in Visual Studio 2015, ALM + ASP.NET 5: Next Level Development by Adam Cogan

This probably the longest title for any of the seminars I’m attending. I have only tried an early beta of Visual Studio 2015 a while back so I have been looking forward to getting some more information on the “almost” stable release.

The interview starts with some history of the tools that has been introduced with previous Visual Studio versions. This leads into five things that Mr. Cogan recommends in Visual Studio Online, they are:
  1. Monaco Editor
  2. New Build System
  3. Scrum and Kanban
  4. Git Pull Requests
  5. Application Insights

The semeinar contiunues with going through some updates for Visual 2015

Roslyn which is the new compiler written in entierly in C#. The Roslyn compiler allows for some new interesting tools like CodeAuditor. Roslyn also comes with some new language operators (C# 6.0) such as the null propagation operator .? which allows for checking for null before executing a function on the object.

Evaluation of LINQ expressions in runtime so that the result of a LINQ can be viewed.

Some additional tools that can be used to assist the development process are NR6Pack and CodeCracker.

Code Lens will be available in the Professional version.

Smart Unit Test which is the new name for PEX.

IntelliTrace will be faster and give more information.

In the end the presentation became quite rushed and Windows 10 was brought up as a good update for Visual Studio 2015 which was a bit weird, however, Adam Cogan is a good speaker and kept the talk interesting and interactive.

Continuous Delivery for Architects by Neal Ford

I was late to this seminar due to talking a little too long about NServiceBus with Sean Farmar at Particular Software booth. When I came into the seminar a Continous Delivery book was on the screen and the speaker was way beyond the introduction. Two other books are shown during the talk, the classic Domain Driven Design by Eric Evans and Implementing Domain Driven Design by Vernon Vaughn.

Mr. Ford talks about how a continous delivery pipeline must be constructed with steps such as commit, functional test, user acceptance test staging and so on. This increases confidence and gives feedback at the different stages. There are no rules for constructing the pipeline but it is up to the architect.

Mr. Ford states that today’s best practices will be tomorrows anti-patterns and goes on to show that the increasing complexity of problems drivers architectural change. The most certain thing is that the code will change and the design should make that simple. The talk continues with tackling some of the problems for constructing the component pipeline.

During the lecture only two tools are mentioned Structure 101 and NDepend and they are used to analyze the dependencies in the code base. The reason these are brought up is to avoid creating dependency cycles. Structure 101 is for java and NDepend does somewhat similar job for .NET. Diamond Dependencies are also a anti-pattern that complicates constructing the pipeline.

Mr. Ford continues the seminar talking about domain driven design and some of the problems with building a micro service design. He brings up the Fallacies of distributed computing as an example of the problems that must be considered when moving form a monolith to a micro service design.

A pretty intense talk considering it was the first one of the day. Mr. Ford speaks well and moves quickly between the topics, definitely worth the visit.

Wednesday, June 17, 2015

First day of NDC Oslo impressions

The first day has been quite intense, lugging around an extra hoodie (conference present) and thick brick of a book has not made things easier. The decision to blog instead of taking notes has also proven to be a bit of an extra burden. My laptop battery gives me two hours of work at best so I’m always hunting for a power outlet, some conference rooms has them some do not, let the games begin.

Most of the seminars have been pretty good, however, since they are only an hour long it does not leave any time for examples or more in-depth discussions. Even though the presentations are on the short side I think it has been really interesting so far and I’m looking forward to tomorrow.

Applying S.O.L.I.D Principles in .NET/C# by Chris Klug


The presentation was changed slightly from the topic and will deal with when to and when not to use the SOLID principles. The presentation goes through the SOLID principles which has already been written about in a million blogs so I will not go into to it here. Each principle comes with an explanation where Mr. Klug would use the principle.

This seminar becomes an in-depth description of the speaker’s usage of the different SOLID principle with his motivations. The motivations are not well founded however it does not feel like it adds something more to the already existing body of work on SOLID.

To NoSQL or Not to NoSQL, That is the Question by David Ostrovsky

We are moving to a polyglot persistence world; however relational databases, in my opinion, should not be overlooked as a solution. David Ostrovsky talk is aims to orient you in the world of NoSQL databases and assist in making a good choice for your needs.

The seminar begins with a run through of a user story for a company that wanted to update to a NoSQL database where the solution end up not being optimal for the company needs. Mr. Ostrovsky, with all right, criticize the term NoSQL since this is a very rough separation. Below is the groupings that were presented in the seminar with short descriptions.
  • Key-Value
    • Simple collection of keys and values, very fast and scalable. 
  • Document 
    • Similar to key-value but the keys are known to the database so they can be searched and operated on.
  • Row
    • Similar to a RDBM database but with row partitioning with a id for each row.
  • Column
    • Turns the storage so the column information is stored sequentially on the physical disc. 
  • Graph
    • Uses graph structure to store data which allows for graph theory to search the data.

Using SQL has many advantages and many SQL flavors today support sharding and clustering. It has also been around for 40 years and it easy to find developers for SQL applications. However if the data structure is very complex or the dataset starts becoming so large that you have to give up functionality such as indexes and joins Mr. Ostrovsky suggests that it is time to look at NoSQL solution.

A use case of storing tweets on a row database is discussed, the row database is a good choice since it has very low latency for writes. This leads in to a run through of the CAP theorem. Since network partitioning cannot be controlled it basic comes down to selection if the database should have high consistency or high availability.

The futility in benchmarks is pointed out. The best comparison is to model the actual use case for the different databases and also populate the databases with this model and measure that.

The seminar ends with an example of using Cassandra to store tweets as mentioned earlier. For those not versed in the world I would think this seminar would be a excellent primer, however an even better solution would be to read NoSQL Distilled by Martin Fowler.