A strange ASP.NET MVC friend that I met on my journey to Vagaman

It was a crowded day , more than that it was a hartal day; so there was only few buses expected to operate. After waiting for 2 hrs I got the bus that I was waiting for, it was the only bus that is to go to Vagaman, hill station located in Kottayam- Idukki border of Kerala, India.I was the first guy to get in the bus that was clear empty as a class room on a extra class day in College. I rushed to a window seat so that I can see all the colors dazzling through. When the bus was about to take two young chaps rushed inside bus, I was pretty sure that he was not mallu’s. The only seat that was now empty was the seat next to me. He approached to my seat. I asked him to where are up to. He was also heading to Vagaman. He was a software professional and to my surprise he was also a web application developer same as me, but different framework. He told me he uses ASP.NET MVC for developing his applications. It was the first time I heard the name ASP.NET MVC. The thought that came to my mind first was why should I need MVC, when I can develop application on plain ASP.NET, and to my anxiety I asked him that. To my surprise he told :
You should NOT use ASP.NET MVC if. . .

• You aren’t willing to build on top of the framework
• You rely on 3rd party vendor controls for lots of the UI
• You are not willing to use open-source libraries
Also in order to maintain state in an ASP.NET web forms application, ASP.NET uses encoded data in a hidden form field via a feature called viewstate. Viewstate does pretty well at providing the illusion of a stateful application, but there are times when problems are encountered. For example, in large applications, viewstate can become very large. Large viewstate not only increases your payload across the network, but it can also impact your search engine ranking by pushing readable page content far down in the rendered code. The control over HTML enables developers to build Ajax applications more comfortably, and it adds more interactivity and responsiveness to existing apps. Direct control over HTML also means better accessibility for implementing something that is in accordance with evolving Web standards. In addition, ASP.NET MVC uses interface-based contracts, which allow components to be more easily tested in isolation. As a result, cleaner and more testable code is often promoted as a good reason to embrace ASP.NET MVC. The runtime environment is the same for ASP.NET Web Forms and ASP.NET MVC applications. The view engine can be asp view engine or a razor.
But I again wondered why I should have to write HTML and Javascript when before he could have retrieved all that beautiful information with a simple postback. I asked him this question, he was very quick to respond, meanwhile bus was moving very fast indeed :

 Rob Conerey (Microsoft employee at the ASP.NET MVC team and creator of SubSonic ) explains why developers should learn mvc  after observing questions raised in the community.
In his introduction he starts off by describing WebForms as “The Great Lie”:

WebForms is a lie. It’s abstraction wrapped in deception covered in lie sauce presented on a plate full of diversion and sleight of hand. Nothing you do with WebForms has anything to do with the web – you let it do the work for you.
Rob lists 7 reasons for using ASP.NET MVC or in his own words “7 Reasons To Stop Calling Me A Jerk”:

• Testability
• Control over HTML
• Extensibility
• It Makes You Think
• Differently Javascript Doesn’t Suck
• Learning New Concepts
• It’s Fun
And concludes with:

Bottom line: I’m having fun web programming again and I think that’s pretty motivating, at least for me and my cats. Yet Another Comparison, sure, but hopefully a bit more direct. You have absolutely no reason at all to not learn MVC – but I will concede there may be a reason or two for you to stick with WebForms.
I know many people might think I’m speaking for the rest of Microsoft – hardly. I’m biased and, more importantly, I actually still have my very own brain which forms its own thoughts! I love MVC and I think you will too – just please, please try it before you form an opinion.
It is said that Microsoft initially created ASP.NET MVC (in roughly 2007-08) as a proof of concept to demonstrate that it was possible to apply patterns such as Model-View-Controller (MVC) to ASP.NET. (The MVC pattern, which is frequently used in the design of web sites, aims to separate data, business logic, and the presentation to the user. The challenge in many cases is keeping business logic out of the presentation layer. However, no IT manager will spend money on new software solely because it applies patterns.
ASP.NET MVC provides total control over HTML and it offers cleaner interaction with inline JavaScript. If this statement doesn’t sound exciting enough at first, then consider that it is exactly this freedom that enables the development of pure Ajax solutions without tying a site to a specific commercial framework. To this end, ASP.NET MVC undoes to one of the best-selling points of ASP.NET Web Forms when it was introduced a decade ago, It shielded developers from the details of HTML. In contrast, ASP.NET MVC stays closer to the metal of HTML and HTTP, and it gets rid of the thick abstraction layer built on top of Web Forms (viewstate, server controls, page controllers, event-based page lifecycle).
He told me lets go in detail:
By default, when starting a new MVC project, Visual Studio offer to create a new Unit Test project based on Microsoft’s Unit Test framework. Other Unit tests framework can also be configured to be used by default instead of Microsoft’s solution. The ASP.NET MVC framework includes a flexible URL routing system that enables you to define URL mapping rules within your applications. The routing system has two main purposes:
• Map incoming URLs to the application and route them so that the right Controller and Action method,
• Construct outgoing URLs that can be used to call back to Controllers/Actions (for example: form posts,links, and AJAX calls) Having the ability to use URL mapping rules to handle both incoming and outgoing URL scenarios adds a lot of flexibility to application code.
By default when you create a new ASP.NET MVC Web Application it will pre-define a default /[controller]/[action]/[id] routing rule that you can use (without having to manually configure or enable anything yourself). This should enable you to build many applications without ever having to register your own custom routing rules. In classical ASP.NET form model apps, if the browser is a mobile phone then each page needs to be rendered for the phone or redirect to a separate page for mobile devices, but for ASP.NET MVC all the requests comes in the controller action and this can decide which view to be given back without any change in url.This blog and redirect it to the proper view gives a better idea on this. Also jQuery is shipped with any new project instance of ASP.NET MVC. Since Microsoft announced support for jQuery, it’s been the big buzz in the javascript world. Support for existing ASP.NET features. ASP.NET MVC lets you use features such as forms authentication and Windows authentication, URL authorization, membership and roles, output and data caching, session and profile state management
I became so fascinated about this new approach, I asked him to tell more about its architecture, he continued:
MVC is a framework for building web applications using a MVC (Model View Controller) design:
• The Model represents the application core (for instance a list of database records).
• The View displays the data (the database records).
• The Controller handles the input (to the database records).
The MVC model also provides full control over HTML, CSS, and JavaScript.

MVC Archtecture

Layers of ASP.NET MVC

The MVC model defines web applications with 3 logic layers:

The business layer (Model logic)
The display layer (View logic)
The input control (Controller logic)
• The Model is the part of the application that handles the logic for the application data.
Often model objects retrieve data (and store data) from a database.
• The View is the parts of the application that handles the display of the data.
Most often the views are created from the model data.
• The Controller is the part of the application that handle user interaction.
Typically controllers read data from a view, control user input, and send input data to the model.
This code project link is very good for new chaps like you. Also  this official asp.net site also is not bad to start with.
I enquired him where I could get MVC installable’s, he told : Its simple download it from here .

Suddenly the conductor asked us whether we took tickets, irony is that it pasted 2 hrs till we started our journey. We took our tickets. He asked the conductor at what time bus will reach wagamon, to my surprise he asked this in malayalam, our local language. He told me he knows many languages like the MVC application that can be localized easily. Then I asked him how localization done in ASP.NET MVC. He began:
Creating a multilingual website is not an easy task, but it will certainly allow your site to reach more audience. Fortunately, the .NET Framework already has components that support different languages and cultures. The format for the culture name is “-“, where is the language code and is the subculture code. Examples include es-CL for Spanish (Chile) and en-US for English (United States). Every thread in .NET has CurrentCulture and CurrentUICulture objects. The UICulture determines which resources are to be loaded for the page by the ResourceManager. The ResourceManager simply looks up culture-specific resources that is determined by CurrentUICulture. In order to create different views for every culture, we will append the culture name to the name of the view. For example, Index.cshtml (the default view), Index.es-CL.cshtml (Spanish, Chile), Index.ar-JO.cshtml (Arabic, Jordan). The view name that has no ending is considered the default culture. A default culture view will be rendered if the requested culture name is not implemented explicitly.Some people prefer to use a single view for all languages because it is more maintainable. While others think replacing views content with code like “@Resources.Something” might clutter the views and will become unreadable.
To my doubt I asked him how do we determine which version of a view to return to the end user? He told:
There is a header field called “Accept-Language” that the browser sends on every request. This field contains a list of culture names (language-country) that the user has configured in their browser. The problem is that this culture may not reflect the real user’s preferred language, such as a computer in a cybercafé. We should allow the user to choose a language explicitly and allow them even to change it. In order to do this sort of things, we need to store the user’s preferred language in a store, which can be perfectly a cookie. We will create a base controller that inspects the cookie contents first, if there is no cookie, we will use the “Accept-Language” field sent by their browser. The base controller checks if the cookie exists, and sets the current thread culture to that cookie value. Of course, because cookie content can be manipulated on the client side, we should always validate its value using a helper class called “CultureHelper”. If the culture name is not valid, the helper class returns the default culture. After that, when we call “Return” in controller action methods, the view name is modified by the base controller behind the scenes to reflect the correct culture in cookie or header field. This way we make sure that the user gets the right content based on their culture.
For client-side, we should worry mainly about numbers, date and time, and messages since these change from culture to culture. There are many ways to implement client-side localization. But here are two common options:
• Creating standalone localized javascript files for every culture and language.
• Creating a standard common javascript file for all cultures by sticking to Microsoft Ajax Library.
For example, for the file “myscript.js”, you need to create “myscript.es-CL.js”, “myscript.ar-JO.js”, etc. We can reference the javascript files easily from our views by appending culture name to the javascript file :

I asked him to summarize this, he smiled and told:

• Add a base controller from which all controllers inherit. This controller will intercept the view names returned and will adjust them depending on the current culture set.
• Add a helper class that stores the list of culture names that the site will support.
• Create a single view or set of views for every culture and language.
• Create resource files that contain translation of all string messages. (e.g. Resources.resx, Resources.es-CL.resx, Resources.ar-JO.resx, etc )
• Localize javascript files.

It was at that time his phone ringed and I was able to recognize that ringtone of his phone, it was a old malayalam  song ; Meanwhile we reached Vagaman.The breeze was soo cold.

Tagged with: , , , , , , , , , , , ,
Posted in ASP.NET, MVC

Windows Phone camp @ Taj Vivanta on 29 feb2012

Camp organised by Technopark mobile dev community, Momo was mostly pointing on New Windows Phone 7 OS which is windows answer to android and iOS . One of the speaker told a stat that by 2015, windows will take over 21% of market share and come second to android which will then be 49%. They were 3 guys from microsoft, I would rather say evangelists; they told about various features Windows Phone is offering and to a more extend going through the disadvantages of Android and iOS. They really highlighted about the New UI design engine they are introducing, what they call Metro which means Modern and Clean. Metro presents user with tiles, they say its dynamic tiles but I am bit confused about the dynamicity property for custom applications because for dynamic animated notifications on the so called tile there has to be webservice to the back-end to fetch the info, so what if there are so many tiles and for that say so many back-end calls, it will become a heavy load for the mobile na,what you say?. Also I certainly think this is not a innovation from their part but something different to iOS kind UI design that is followed by top branded smart phone vendors that we see nowadays, where user is presented with lot of icons ;because we have seen these tile kinda design already from them in windows media center. The music player feature gives us a wow feeling that’s for sure, he showed us the windows phone music player ie Zune player what they call fetched the lyrics of the song while the song was playing, to be frank that song was awesome, he said it is his favourite song, song from Carnival of Rust(Poets of fall). The lyrics fetcher is a 3rd party app called musixmatch, who has a DB of almost all songs, but the irony was it failed when he searched for Kolaveri lyrics, an indian viral song sung by one of my favourite actor
Dhanush.The windows phone basically comes with different hubs: People hub, which contains all social networking integration, did I say all, sorry not all but top branded social networking spaces like facebook, twitter,flickr etc; Office hub, which has the ever shining Office applications from windows;App hub, where all other apps resides. What I think about this new approach by windows is they giving a environment for user’s needs and not seperating any similar things , ie bringing similar agenda apps under one umbrella ie hubs. Also the speaker referred the current scenario of sharing a image on facebook in Android and iOS which involves taking picture from camera and get it uploaded from facebook app is like getting out from house, going outside and coming back to home.
The first session of the camp focused on the windows phone features and app development. Windows I think is trying to draw boundaries between the application which is using Silverlight framework and game which is using Xna framework, which I think is a strategy to catch new trend that market swallows, ya Im talking about game development. To start with we had a Hello world app then a simple cheese placer game. He showed a tank game where I was able to guess this new xna game framework rendering is fast and reliable. The UI design is a xaml based and the appliation installable is a xamp file.
Second and last session was more of marketing application, ui guidelines and the really annoying restrictions imposed by them what they say is to prevent malicious apps circulating in their app store. Actually there is already a first round of testing tool in the developing IDE, ie visual studio if you have chosen windows phone 7.1 plateform. But I think that’s more of application manifest level kinda check. Also they say they have strict piracy policies like you cant distribute the app other than from their app store, ya over the air distribution like jad file is a question they should answer. They told about a hack or magic they can make from their side to help the developer distribute the installable within the team during the development stage. They have a enterprise app store solution as well where the download link gets mailed to all members in that group. The application life cycle of a windows app includes basically 4 stages, Running, deactivated, dormant, and activated. If you press a back key from the second screen it will navigate to first and if pressed from first it goes to dormant or it frees memory. If another application is called when running a application, current app goes to background and actuated stage and the developer needs needs to take care of the current application state and decide whether to save it on memory or handle with a file, that’s upto the developer to decide.
The QA section was really informative, it had some wonderful questions from my fellow folks what I would say who were there with me. One of the guy asked why windows does not support gif images, they couldn’t make a convincing answer, they told like gif gives lossy rendering of image, so they just avoided it. To be frank, blackberry, ya that semi smart phone also does not support gif image. One guy asked whether that lyrics that is populated based on the song playing is actually recognizing the music and lyrics scrolling based on the song progress, speaker told he really had that dream but not at this point, what to say people’s expectation levels have really raised and it is going to be nightmare for the mob dev community. There was a question whether a custom app can be added to the people hub, say a new social networking space, the answer was a noo. There was a question about pricing, it is $99 an year for 100 free apps and unlimited paid apps for an account.
In between the First and Second session, I must say there was a tasty session of lunch. I enjoyed that session the most to be honest. That included all veg and non-veg Indian food items. It was a terrible feeling to see the chicken and fish which was to be served laugh while I passed besides them because I was in a lend period where I am not supposed to eat non-veg. The dessert was delicious.
I think I should conclude this by saying that this is one of the best camps I have ever attempted. Thanks to Microsoft and a big thanks to Momo, the event organizer. I think Mobile Monday, Momo is doing a great job bringing in big guns to Trivandrum. I have my good wish and will for them. To stop there was a punch line from one of the speaker, it was “When we introduced Windows Mobile OS, it was a copy of windows desktop os, but now Windows 8 desktop os is a copy of windows phone os “. So don’t count our old mighty windows low on this mobile world, they may be a emerging brand, but the features they offer is there to stay.


February 29, 2012

Vivanta Taj

C V Raman Pillai Road, Trivandrum


Posted in Events, Windows Phone

Alappuzha Beach

This slideshow requires JavaScript.

A few years ago, you could walk some distance out to Arabian Sea at Alappuzha beach in kerala, on the wooden boards of the dock, and see the blue waters through the clefts. The ebullient waves would then tell you a story, of the proud ‘Venice of the East’ that was once the gateway to Kerala, much before Kochi signed off as a harbour of choice. Over the pages of history, Alappuzha dropped its past and blended with the future, more like an oil film, floating on the surface of water, while shielding cultural treasures deep inside its heart. Everything about this town flaunts that by gone feeling – the colonial era government mansions, still grand and graceful despite the years, the canals, green and coated with weeds, filled with boats carrying hay or bananas. Enjoy Alleppey beach vacations in Kerala India.

Alappuzha’s eternal motif, its sea, however remained as attractive as it was before and dangerous in equal measure – knocking angrily as it did during the tsunami of 26 December 2004, which eventually created a news stir, before shattering into white bubbles of penitence. Visit during sunset and you’ll find the same sea quitely jostling against the pure white sands, its waters abundant with catch for the fisherfolk. The shades of green also reflect themselves in the shimmering backwaters, the region is famous for. After meeting the roaring sea, you can enjoy a lifetime boat cruise on the emerald backwaters by a romantic night, the famous attractions of Alappuzha beach.

Beach Attractions : Lakes, Lagoons Open Sea,
Around Alapuzzha : Arthunkal – 22 km,
Cherthala – 20 km,Vayalar – 2 km.
To Shop : Sea Shells, Handicraft Items made
from Seashells.
Getting There : Nearest Airport –
Kochi International Airport – 85 km.Nearest Rail – Alapuzzha – 5 km.
Don’t Miss : Meeting the Sailors of Allapuzha and
watch them catch Fish.
Inside Tip : Take precautions while indulging in
Sea Sports. Seek the help of our Guides.
Activities : Sunbath on Beaches, Boat Cruise,
Fishing, Backwater Destination Cruise.
Must Watch : Nehru Trophy Boat Race.
Where to Eat : Hotel Green Corner, Hotel Aaryas,
Gujarathi Street, Kalpakavadi Inn.
Staying Options : Marari Beach Resort, Alleppey Beach
Resort, Alleppey Prince Hotel, Marari Beach Home, Anamika The Villa,
GowriHeritage Home.
Tagged with: , ,
Posted in Alappuzha Beach, Ma Voyage Gallery

Pattumala Church

This slideshow requires JavaScript.

This place is located on the road from Peermade to Kumily. It is almost six Kilometer away from Peermade.The place is surrounded by Beautiful Tea plantations,and hills. The place itself is on top of a small hill .The road decent on either side of the place.There is a beautiful Velankanni Matha Church made entirely of granite here.It is a famous pilgrim center.Two most famous tea estates namely AVG and Co and Harrisons Malayalam are also located here.

There is a flower garden near the place with facinating riot of colors of rose orchids and Anthurium. The meaning of Pattumala is Hill of Silks.Pattu means Silk and mala means Hill. During 1966 the Franciscan Missionary Brothers built an Asrama here and started working for the upliftment of people.Later it was noticed in the interest of people in worshiping the Velankanni matha or the Lady of Velankanni.Due to this the priest reported this to the church authorities.So in 1981 a sculpture of the lady of Velankanni was brought from Velankanni to Kottayam where it was blessed and then it was brought to Pattumala via a procession.This sculpture is exhibited inside the room aside of the road at Pattumala.

Later this new church was built during 1989.The architect was an Italian called Br Hipolitus.The old chapel can be also found at near the new church.

How to Reach:

Move along the route to Thekkady from Peermade  for 6 Kilometers and you will reach Pattumala

Tagged with: ,
Posted in Ma Voyage Gallery, Pattumala Trip