Software Architecture


There is a design shift as software starts moving to the cloud, from an in-prem situation.

There are a few changes  that you have to make in your design. e. g. the database may not always be available at all times, so retrying a connection makes sense.

One of the side-effects of this is that we can use some design patterns from nature, or the hardware world.
Using Hadoop or (as it it is called) HDInsight in Azure, we can have very simple functional blocks perform very complex things.
This is kinda why Map/Reduce was invented in the first place by Google.

Anyway, what this means for our software design, is to have more modular blocks (or classes and methods), and they should perform a set of tasks very well. They won’t even know of the big picture, and don’t need to.
Any good software design more or less is designed this way but try to make the units kind of self-contained, rather than always having a master-controller somewhere.
Not having a master-controller is the ultimate path to infinite growth, because then each unit does not have to come back to the master.
Only some factory method needs to be able to be called and produce these identical worker units.

More and more, this kind of system resembles of the best examples in nature viz. ants.

Take a look at this article and video here.

For many years, I have wanted to move on from Microsoft technologies and do a mix and match where I have the choice of which platform I target or what phone I develop for.
This was hard to do in the old days where one was stuck in the ecosystem one chose from the start, but I see it is much more possible nowadays to go across platforms and you do not have to choose your poison from the start, but you have more flexibility in what you want to target later in the game.
As software developers, the concepts and what you have learnt is pretty much the same across all platforms, so your knowledge is not lost at all and only the tools change.

2 things kept me in the Microsoft ecosystem…the Windows Phone and Visual Studio, which is the best IDE out there (even now). Also, the tools make it easy to deploy to the cloud or Microsoft Azure, so that is my cloud of choice for now.

But now I see the Windows Phone is not going anywhere (for a while, at least) although it was a wait and watch game for a while, and I was hoping that it would catch on.
It is ironic because the Windows Phone has the best interface, but the iPhone and Android phones far outweigh its popularity and use.

With tools like Xamarin Studio and PhoneGap, it becomes easier to target other platforms and so one is not stuck with only developing for the Windows Phone in C#.

So, lets analyze and breakdown things and understand where we are as developers.

As an architect, it is my responsibility to not be biased towards one platform but to provide the solution and platform which has the best bang for the buck.
Of course, the solutions and platforms run a whole gamut from open-source software to the paid, more proprietary stuff.

There is no general answer but it is subject to the needs and the circumstances of the client and the answer is similar to what most Architects will give you…”It depends”.

Let me list the various features of every platform (of the big players out there), so as developers, we know what choices there are, and where to go from here…

Common, across all platforms and companies
————————————————————

Client-side technologies – jQuery, Javascript, CSS, Knockout, Modernizr, etc.

 

Microsoft
————–

IDE – Visual Studio

Platform – .NET

Languages – C#, F#, Visual Basic, Typescript, etc.

Technologies – WP8, Kinect, Windows 8, Microsoft Azure

Client-side technologies – SignalR, Knockout (in the box), Modernizr (in the box), LeSS, TypeScript, etc.

 

Google

———–

IDE – Eclipse, NetBeans, etc.

Platform – Java runtime, ChromeOS, etc.

Languages –  Java, etc.

Technologies – Maps, G+, BigQuery, Glass.

Client-side technologies – JavaScript, etc.

 

Apple
———

IDE – XCode

Platform – OS X, Linux

Languages – Objective C, C++

Technologies – iPad, iCloud, iPhone, etc.

Client-side technologies – etc.

Just thought I’d write a quick post with some extension methods that you can use for cleaning up strings.

The core of these extension methods are regular expressions, and if you understand how they work, you can roll your own using this pattern.
If you don’t, you should read these:
http://msdn.microsoft.com/en-us/library/hs600312.aspx
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx

I feel that mastering Regular Expressions is very important for string manipulation.

Let’s take the example of an application which provides a text-box for phone numbers, where the user can enter a phone-number in any format and then you would just like to extract the numbers to do a search.
It boils down to stripping the input of non-numeric characters.

I would write an extension method like this:


namespace String.Util
{
    public static class Extensions
    {

        public static string StripNonNumbers(this string input)
       {
             //strip out non-numeric chars from input
            string stripped = Regex.Replace(input, "[^0-9]", "");
            return stripped;
      }

.
.
.

The Regular Expression above essentially matches non-numeric characters and replaces them with an empty string, so you get a resulting string containing only numbers.

You could tweak this with some really powerful expressions for your purpose.
For e.g. In place of [^0-9], use [^a-zA-Z] to remove non-alpha characters or [0-9] to replace numeric characters

Then you just reference String.Util in your target module with a Using statement and invoke it like:


string cleanPhone = phone.StripNonNumbers();

Notice the down-arrow in the Intellisense for a string’s methods, which indicates that it’s an extension method.

If you’re not already familiar with Extension methods, they are a cleaner, functional programming way of writing Helper methods. They are not more efficient necessarily but make the code much cleaner and I would encourage you to use them when possible.