Thursday, April 09, 2009

10 reasons why silverlight 3.0 excites me…

10 reasons why silverlight 3.0 excites me…

1. It really enforces good architecture: With principals like MVC (M-V-VM) implicitly into client side Xaml, DRY(Don’t repeat yourself) Built into RIA services and Scaffolding feature (Service Context) binding with ORMs like Entity Model and L2S (LinQ to SQL) in place, the solution is rock solid and very scalable.

2. Extensible architecture: Think Dependency injection / inversion of controls. Silverlight XAML dynamic loading makes such task easy and manageable. Learning curve to achieve the same is intuitive and les cumbersome than most of the other libraries.

3. Silverlight implicit collections: Language features embedded in XAML (silverlight rendering engine langauge) are powerful. Observable collection, Converters, Dependency property really makes it easy to develop new controls.

4. Data binding features: With SL 3.0 data binding is almost like its WPF counterpart. Bind almost anything to everything declarative. Programmers delight!!!

5. Animations /2d/3d mathematics: With excellent effects and very intutive matehmatics involoved in 2d / 3d rendering, Silverlight is way ahead in terms of other packages in which programmer is supposed to do more matrix multiplications rather than business problem in hand!!! (think of programmer who has to make a custom graph)

5. No more coding for specific browsers: Code in C#. No code in javascript. No coding required for each and every version of x,y,z browsers!! And SL will ensure it runs just fine..

6. In built SEO / Deep linking:

7. Support for Dynamic languages like Iron Python and Iron Ruby: This is specially exciting. Ploygot programming was never so easy. The mathematical capabilities of languages like python (it can parse expression like (2+4) * 5 + 6 / 7…) makes it very easy when required. And the deal is required when UI is supposed to look great..

8. Great Component support:

9. Out of browser experience: With features like Isolated storage and LINQ embedded. Offline experince is really great and very easy to implement in contrast with Google gears and SQL Lite.

10. Most important: INNOVATIONS : Great tools for development like VS, Blend and even XAML PAD!! Server connectivity, Binary serialization, Deep Zoom. The pace at which SL has adapted and grown is awesome.

Blogged with the Flock Browser

Monday, April 06, 2009

Discussing SilverLight!!

I was having an discussion with my wife on things to come in computer software and silverlight. below is a brief snippet:

My wife holds an computer engineering degree and is passionate about new innovations. She is a prolific programmer though she ONLY codes when she feels like(or finds a problem worth her attention) and thus is NOT a regular coder like mortals like me who are ... well, just coders, who codes for money:D


Wife: What is this buzz around Silverlight?
Subodh: Because we need smarter applications which makes extracting the required data easy and more meaningful. See; as human beings we require information. Computers provide information to us; but extracting the data using computers is cumbersome. Not many people are skillful in extracting the right information. As developers of applications our main motive is to provide easiest way to provide the information.
RIAs are a great platform as they provide animations, have in built ways to communicate with server asynchronously. The RIA application is smart enough to do some data crunching on its own and require to connect to server only when some data is required.

As we move towards smart clients; and as more people are comfortable with browsers; the momentum is towards RIAs which combine the goodies of a smart client within browsers. Silverlight provides an easy approach towards developing RIA as developers can leverage on the knowledge they aleady have on .Net platform.

Wife: I got it... But Why Silverlight? what exactly is Silverlight?
Subodh: Actually as with every platform, Silverlight have two faces. From a user perspective, Silverlight is a browser plug-in which when installed will provide Rich user experience to the user. The plugin is free download. Also the plugin is per OS and NOT per browser. what that means is that when silverlight is installed, the application built on top of it will work exactly the same on any browser ; be is IE, firefox or flock.

From a developer perspective Silverlight is a new development platform for developing RIAs. It interestingly takes all good practices from .Net platform.
For UI: SL uses XAML;
For event handling mechanisms: Javascript may be used in SL1.0; C#, VB .net may be used for SL 2.0; and there are languages like IronRuby and IronPython which is supported Silverlight Dynamic Language Runtime(DLR).
For comminicating with Server: Silverlight supports Http WCF. It also supports duplex. It even supports Sockets.


Wife: umm..  We have Silverlight 2.0... Whats deal with 3.0 version...

Subodh: Actaully, i personally like SL because it is the MIX of so many good things. The drive for SL3.0 is to bring in good practices. Now that SL2.0 is stable, the move is towards to bring in patterns like MVC (MVVM to be correct) and domain driven design. (DDD).
So we see that SL30 have a navigation project which supports features like deep linking and back and forward history of browsers. It even supports SEO. (search engine optimization)

DDD is implemented by using a Domain service, which works on the principle of DRY(Dont repeat urself). ROR(ruby on Rails) has been using the principle successfully. Domain service takes the pain out which was required earlier like creating a WCF service exposing it and then writing plumbing code to hook to the server side WCF service. Now the code at the client side is generated at run time, so the developer concentrates on just the Domain service. The validation logic is also put as cross cutting attributes on the entity property itself.

Wife: i got the MVC and the DDD part; what else is new in SL3.0?
Subodh: SL3.0 also now supports the WPF style of databinding in which an object property may be directly binded to another object declaratively in XAML itself... There are really some cool stuff which may be archived out of that just writing plain XAML. For example: a Domain service may be declared in XAML and binded to any controls data binding property with paging, filter and grouping stuff mentioned in XAML itself!!!! :D

Wife:  thats cool... I hear there is a lot on the SL UI controls also??
Subodh: Yes there are lot of new controls, for look and feel ; for graphs and dock panel etc...Also SL3.0 also have a support for 3d now!!! :D
And then there is support for scaffolding which makes programming RIA really easy.

I hope the above conversation will help you get the basics of SL...
I will be sharing some really interesting finding and gotchas on SL in nest series of blog.
Do keep your comments/ suggestions coming in.
Blogged with the Flock Browser

Thursday, April 02, 2009

Using Flock for Blogging

All entries are blogged using FLOCK: - my favorite browser.. :D
Blogged with the Flock Browser

Silverlight Demos

Hi,
I gave a talk on silverlight capabilities and thought it is a good idea to share. The talk was intended to demonstrate the silverlight as a RIA developement tool and cool stuff which may be accomplished.

Following is the snapshot of MindMap DEMO built in silverlight 2.0.
It has Zooming, Panning features. Provides an visual feel of underlying XML data.


Below is the snap shot of famous flip book demo. I have tweaked it to get "feed" from Powerpoint slides. I actually gave the presentation while flipping the pages. :D



As talk was for developers who have experince in other technologies other tahn silverlight.. i decided to demonstrate a Visual sorting demo to provide more techie gotchas and spark. You may see Merge sort in action below


Lastly the 3d



Will be publishing the source code soon once the bandwidth allows me to!!!

Wednesday, April 01, 2009

Silverlight Presentation and demos

With the dawn of Silverlight 3.0 platform, i have realized more and more application will move towards RIA development.
Below is a presentation of the talk which briefs on Silverlight.

I have uploaded it on http://app.colaab.com/R/680fa4c6-8b3f-402e-bbd3-9bde00962502, incidentally which is also a great silver light application.

Though i like it more when it comes to architecture and coding related with silverlight, I have deliberately kept the above presentation light so that it makes sense to even a non techie.

Of course tons of Demo are included. I will be loading them as well along with the screen shots.

Wednesday, March 25, 2009

Hi,
I spent last few months working over an interesting scenario where there was a requirement of

1. Getting rates from various carriers (FedEx, UPS)
2. Booking a shipment etc.

I short using the APIs exposed by various carriers and use it so that the proposed system may consume the information uniformly.


Following is a brief commentary on how WCF was used to make the system highly scalable (both horizontally and vertically) .
the high level architecture looked like:-

WCF Architecture for Regal




The interesting part of architecture was that each carrier used a common interface. Hence the consumer of the exposed service was only bothered about dealing with a standard set of entities without worrying about the complexities involved in calling and consuming APIs of each carrier.
We deployed the services on TCP(using configurations) and exposed the common interface to the client (which in our case can be WEB application or Windows service) along with a ProxyHelper class which creates channels on demand and keep it in cache (Dictionary) for further use.
Even the Data layer was exposed as WCF service.
By exposing each layer as WebService we made sure the architecture is highly configurable and scalable without comprimising on other aspect.

Another interesting part was reading EDI (Electronic Document interface) which i will be blogging soon in my next series of blogs.

Tuesday, March 24, 2009

Reviewing Ruby on Rails !!

I am a great fan of rapid application development techniques and lately had a chance to revisit the various frameworks which allow the same. Though I am a .net developer and Silverlight enthusiast, my findings below are without any prejudice and I will like to hear from you if you have something to add or you have altogether a different viewpoint.

During the above research, I was also inclined to determine what factors lend towards a platform to make it fit enough to use it.

Below are few major ones:

1. Rapid development:

2. Facilities provided:

3. Database Interaction:

4. Major Architecture Paradigm followed:

5. Supported UI:

6. Learning curve:

7. Delta between what is already known and what we must acquire to start using the framework:

8. Best Suited for scenarios:
Ruby (Ruby on Rails)

My encounter with Ruby has mostly as Iron Ruby-- port of Ruby which runs on Microsoft platform proclaiming Iron Ruby as Dynamic Language.(http://silverlight.net/learn/dynamiclanguages.aspx)

My first candidate was Ruby (RoR, to be specific.). I like Ruby as a language and like to use it as a Proof of concept for most of the complex algorithms I tend to use while programming.

While Ruby provide great features like "duck typing" and lambda expressions, the thing which I liked most in RoR is intelligent use of Design Patterns, without even bothering the end users of the framework to be concerned about it. By doing that all the "Good Practices" are embedded deep into the architecture during development inherently. Compare this to Microsoft CAB and SF (now known as Prism, in which things get quickly dirty if the developers are not comfortable with the design pattern aspect).

The design patterns like MVC, Scaffolding definitely have a mileage over just plain website of ASP .net.

You may argue (as one of my friend insisted) that ASP .net also have "scaffolding like" features and Visual studio is very capable enough to have a data driven website running within few hours flat(using famous datasets etc). However, the solution generated by Visual studio lacks the architecture which is demanded by any professional application. (Read n tier architecture, TDD design, etc).

The scores along with arguments were

1. Rapid development: Score - 9. I was able to create a working website (MVC implemented along with database in SQL LITE) in 1 hour flat. I must admit I was just plain amazed by the sheer power of RoR framework which generated the directory structure and the code with few simple commands.

2. Facilities provided: Score - 8. Ruby on Rails is intended to emphasize Convention over Configuration (CoC), and the rapid development principle of Don't repeat yourself (DRY). Compare this to N tier Microsoft architecture where services (WCF services) are essentially doing the same task (mostly to delegate to the layer which actually does the task). DRY is essentially something which is missing in most of architecture.

Here is a demo:

Layer


UI


Business Layer


Data Layer


SP / DataBase

Functionality


GetData and bind to grid. Make a GetData Call to BusinessLayer


GetData and filter based on business logic . Make a GetData Call to DataLayer


GetData. Make a GetData Call to SP / database.


GetData

















Read the BOLD text and you will realize that we are repeating ourselves and then also think that how many times we have seen this architecture!!! I am sure your answer will be MOST OF THE TIMES. :D

I idea is not to eliminate the calls but there has to be a way in the framework which will do the plumbing work wherever repetitions are required, if any.

"Convention over Configuration" means a developer only needs to specify unconventional aspects of the application. For example, if there is a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table "products sold” that the developer needs to write code regarding these names. Generally, this leads to less code and less repetition.

Consider another example where you specify a database column as:

Name Varchar(50) Not Null.

Then in the UI also you end up writing the same code implementation in form of RequiredFieldValidators. Etc. The logic for field’s validation is scattered on UI as well as Database. The idea is to keep the logic at single, unambiguous place without tight coupling of layers.

3. Database Interaction: Score – 8. Ruby again does fairly well in this aspect as well. For example, using the ActiveRecord module of Rails, the developer does not need to specify database column names in class definitions. Instead, Ruby on Rails can retrieve this information from the database.

From .Net perspective we must use an ORM (Object relational Modeling) tool to achieve the same, and as ORM tools are third party, each ones have their own pros and cons. Some of the great ones I have worked on are LLBL gen (http://www.llblgen.com/defaultgeneric.aspx) and Genome http://www.genom-e.com/.

4. Major Architecture Paradigm followed: Score - 7

· MVC

· Convention over Configuration (CoC),

· Don't repeat yourself (DRY).

· Scaffolding

· Duck typing

· Extensibility: Apart from standard packages, developers can make plug-in to extend existing packages.

· Missing features are: Plug and play functionality (read IOC: inversion of control / Injection Pattern) required so much by almost every professional application. Most of the other patterns like Command etc required by windows apps are missing and must be implemented by hand.

5. Supported UI: Score- 10.Great UI support with excellent support for AJAX. Framework generates all plumbing code required at client side to make AJAX call and the server responding to the request, automatically. Compare this to ASP .net AJAX in which a lot of code is still required to be written for AJAX call. Also most of this code is repetitive both in architectural and business sense.

6. Learning curve: Score – 5. The learning curve associated is very steep. Agreed it may be very easy to build a website but when it actually comes to implementation and tweaking of “conventions”, Ruby may require a great deal of inside “know –hows” of how actually RoR works and other details of “Design patterns” Like MVC, AJAX etc.

7. Delta between what is already known and what we must acquire to start using the framework. Score – 4. There is a HUGE gap for .Net developers. For a Vanilla website developer the intricacies of the RoR may be just to demanding as it expects a great deal of architectural knowledge from them. For instance: A website developer may ask that I do have a MVC (as in ASP .NET aspx page and its code beside .cs / .vb file, NOT to be taken as new MVC .net framework) then why create whole separate classes for these and what are the benefits.

8. Best Suited for scenarios.

· Small to medium websites requiring quick User responsiveness.

· Applications may be deployed over various web servers and not confined to IIS.

My personal verdict for RoR was - It’s great when used for small to medium website like applications. Also the programming paradigm which Ruby follows still requires a very steep learning curve from .net programmers.

In next blog I will be writing about my previous and current project learning’s and architecture (in .Net world) used which implemented the paradigm laid down by RoR and Ruby. I will be blogging on The Castle Project (http://www.castleproject.org/) and the good stuff it brings along. I will be also talking about how .Net (3.5 and 4.0) scores over each of the above in its all new avatar.