Showing posts with label HTML 5. Show all posts
Showing posts with label HTML 5. Show all posts

Sunday, December 11, 2011

Silverlight 5 released !! more access or security threat

Finally it is released. Earlier than expected.
http://www.silverlight.net/learn/overview/what's-new-in-silverlight-5

Nobody said that this is the final version in the Silverlight line as a web technology.But it can be because  Microsoft as a product company started promoting HTML 5.Look at their new OS windows 8. We can even write native windows applications using HTML5 and javascript.

For the developers who still think that Silverlight will be available for long as a web technology, I have a small story .No its not a story its the history of web applications which brought RIA.

The History of RIA

Long long ago when speed of the internet connectivity was in single digit Kb/s, developers created browsers and people started using it. The job of the browser was simple. Get a server address known as URL from the user then retrieve some text from that URL address using socket and port, mainly port 80 and show that text to the user. If the retrieved text contains any markup tags, format the text between the start and end tag according to a name of the tag. That tagging or formatting language known as HTML.

Later there came a scripting language which is executed by the browsers .This make people embed some code which will understand the page and even can modify the web page during runtime. But different browsers supported the language in different ways which made it difficult to write programs.

Years passed .The speed of internet connection started expressing in double digits and at some places the unit Kb/s changed to Mb/s along with the fall of connection cost. Then people started thinking about the shortcomings of the HTML. They figured that if they want to draw a curve there is no inbuilt option to draw other than putting an image which adds load to the downloading content.This also reduce the quality when the same page is opened in big screens with high resolution.Another scenario they faced was lack of an option to refresh small portion of page. This demanded the HTML to support more tags and specifications. The people / panel who decides on HTML told changing the HTML specs is a long process. We cannot change it overnight. It will takes years to evolve. You need to continue using the technology as is.

Some smart people effectively utilized this scenario .They didn't go to change the HTML specifications or the way browser deals with the tags and javascript. They created their own system which has it own run time independent of browser ,programming language, designer applications etc...They just asked browser "Can we get some space in your page?" The browser agreed and in the borrowed space they started playing.

Wow...That was the first impression from people who saw these plug-ins in their browser. Its great,lets put it everywhere.This made a good competition in RIA.RIA is the name given to this technology and it stands for Rich Internet Applications. Investments on RIA technology increased rapidly. Even some people started creating their entire application in RIA excluding the HTML. But one day..

As agreed earlier the governing body of HTML, planned to release specs on new version called HTML 5. This has enough tags to support short comings of old HTML, specification for javascript and much more. The RIA world got panic first but after that it settled down and one of them said that they are stopping their RIA and you can have a tool which will convert your RIA applications to HTML 5. Another RIA vendor said you can even create desktop applications using HTML 5 and Javascript.

Everybody accepted and the world became ready for HTML 5 .Isn't it?

What is next with Silverlight 5


Now Silverlight web developers can directly access so many resources at client side even in the InBrowser mode. From the application developer's view its a great help,but just think from the system admin's / security personal's  view. They need to open up machine to an outside web application which may take up anything from the system or do anything to the system. I agree that there are certificates and other security measures. But don't know why I can't fully agree with this which makes it less different than a desktop application.

I guess in near future if Silverlight as web technology survives HTML 5 ,we can hear about Silverlight VIRUS or some threat which may make it unacceptable. But as a developer I love Silverlight as it is the technology in Windows Phone :-)

Monday, November 22, 2010

Silverlight training - some questions

After a while I had to conduct training in my company.Earlier it was WPF and now the topic is Silverlight.I dont know whether Silverlight training is relevant now because of HTML 5.According to me next version of ASP.Net may be 5.0 or 6.0 will emit html5 which may reduce the need of Silverlight in the RIA world.But in other context Silverlight is valuable because of Windows 7 mobile development.

Anyway I have started training and conducted one small test in order to evaluate my students.I am not going to share their scores but some questions I have asked.

  • Which code snippet determines whether the Silverlight application is running inside browser or OOB?
    1. App.GetState()
    2. System.Windows.Application.Current.IsRunningOutOfBrowser
    3. System.AppDomain.CurrentDomain.IsRunningOutOfBrowser
    4. Silverlight.IsRunningOutOfBrowser
  • Can we create folder in IsolatedStorage? (Yes/No)
  • Can we redirect the browser to a ASPX/HTML page from Silverlight?(Yes/No)
  • What is possible in OOB without using COM objects?
    1. Access registry
    2. Access file from C: drive
    3. Access file from MyDocuments
    4. All
  • Is it possible to refer a WPF 4.0 dll in Silverlight? (Yes/No)
  • Where we normally specify the window less mode?                           
    1. Hosting HTML page
    2. App.xaml.vb
    3. MainPage.xaml.vb
    4. None of the above                           
  • Where is isolated storage located?
    1. Main memory of server
    2. Hard disk of client
    3. Main memory of client
    4. Database
  • Can <Resources> tag in a xaml page contain a boolean value?(Yes/No)
  • Can we write code behind of ABC.xaml in XYZ.vb? (Yes/No)
  • Can Silverlight application access ASP.Net Session variable?
  • How Silverlight application gets values from its browser host at initialization time?                               
    1. Through constructor of App class                               
    2. Through Environment.CommandLine property                               
    3. Using ProvideInitValues event                               
    4. None of the above
  • How to add a resource programatically?
    1. Me.Resources.Add(1, New SolidColorBrush(Colors.Green))
    2. Me.Resources.AddResource(1, New SolidColorBrush(Colors.Green))
    3. Me.AddResource("mycolor", New SolidColorBrush(Colors.Green))
    4. None of the above
  • What is the base class of UserControl class?                           
    1. Control
    2. UIElement
    3. DependencyObject
    4. UserControlBase      
  • How Silverlight application can access SQL database ?
    • Through SQLDataAdapter
    • Through ODBC connection
    • Using WebService
    • Using Windows service     
  • Last question was to create a simple <Grid> based layout of a login page.

If you are a Silverlight developer you may feel that some questions are silly or too simple.But my students are in different categories.Some had projects in Silverlight others are hearing word Silverlight for the first time.So its a mix and people can just start learning concepts even if they are not able to answer.

Hope I don’t have to provide answers to these questions since all are known.Let me know if anybody needs clarification.

NB: These are not Silverlight interview questions and I think nobody will ask these type of questions in interview.