Recently while I was attending an interview I came across a question Static vs Singleton. Though I know the differences I couldn’t answer it properly, as I was not refreshed my programming knowledge before the interview.
I would like to quote a reference to Jalpesh’s blog article (www.dotnetjalps.com) explaining the difference:
Difference between Static and Singleton classes:
- A singleton classes allowed to create a only single instance or particular class. That instance can be treated as normal object. You can pass that object to a method as parameter or you can call the class method with that Singleton object. While static class can have only static methods and you can not pass static class as parameter.
- We can implement the interfaces with the Singleton class while we can not implement the interfaces with static classes.
- We can clone the object of Singleton classes we can not clone the object of static classes.
- Singleton objects stored on heap while static class stored in stack.
- A Singleton class can extend the classes(support inheritance) while static class can not inherit classes.
- Singleton class can initialize lazy way while static class initialize when it loaded first
- Static classes are sealed class while Single ton classes are not sealed.
Credits to Jalpesh Vadgama – “Computer Geek, Developer, Mentor, Life long learner, 10+ Years of Experience in Microsoft.NET Technologies, Awarded Microsoft Mvp(C#) for year 2010,11 and 2012.”
February 23, 2015
.NET, .NET Framework, ASP.NET, ASP.NET 4.5, Azure, Azure SDK, BCL(Base Class Library), C#.NET, IE, IIS, Microsoft SDKs, Portable Class Library, SQL Azure, SQL Server, Updates, Visual Studio SDK, VisualStudio, VS2015, WCF, Web API, Windows Phone SDK, Windowz Azure
Microsoft today has released Visual Studio 2015 Community Technology Preview 6 (CTP 6), which includes some new features and improvements, such as new UI debugging tools for XAML, new Control Flow Guard security tool, and feature updates to ASP.NET framework.
For more information about what’s new in this release, please see the release notes.
Download Visual Studio 2015 Ultimate (web | iso)
November 12, 2014
.NET, .NET Framework, .NET Framework 4.5.2, ASP.NET, ASP.NET 4.5, ASP.NET AJAX, ASP.NET MVC, Azure, Azure Tools, C#.NET, Microsoft, SignalR, SQL Azure, Updates, Visual Studio 2013, VisualStudio, VS2013, WCF, WCF Data Services, Web API, Windowz Azure
Microsoft has released an update for Visual Studio 2013, this update is the latest in a cumulative series of feature additions and bug fixes for Visual Studio 2013.
Download VS2013.04.exe (Online/Web Install)
Download VS2013.04.iso (Offline Install)
For more information,
For more information:
Also see Visual Studio Updates and the Visual Studio Update KB Article.
Watch Channel 9 Series on VS 2013 Update 4
September 12, 2013
.NET, .NET Framework, .NET Framework 4.5, ASP.NET, ASP.NET 4.5, ASP.NET MVC, C#.NET, HotFixes, Microsoft, Updates, VisualStudio, VS2012, Windows, Windows 8, Windows 8.1, Windows Phone
Microsoft has released the Visual Studio 2012.4 RC3 Update for Visual studio 2012. This update includes lots of bug fixes and improvements.
Here are some informative links for you:
August 12, 2013
C#.NET, Codes, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile-Development, VisualStudio, VS2012, Windows, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, XAML
This post will give you an overview on how to identify the sensors supported on your Windows Phone. As a developer when you are developing for Windows Phone – and your application would need to interact with certain sensors in windows phone to achieve a certain functionality, you would need to verify whether the sensors are supported in targeted devices.
Windows Phone 8 platform has support for the following sensors
- Motion sensor
You can access these API’s through the below namespace:
You can check for any of the sensor support through “IsSupported” boolean property of the class
- Motion sensor [ Microsoft.Devices.Sensors.Motion ]
- Accelerometer [ Microsoft.Devices.Sensors.Accelerometer ]
- Compass [ Microsoft.Devices.Sensors.Compass ]
- Gyroscope [ Microsoft.Devices.Sensors.Gyroscope ]
Here is the sample code block:
public static string GetSensors()
StringBuilder sensorsList = new StringBuilder();
Note: Only Accelerometer is supported in Windows Phone 8 emulator. To test remaining capabilities, you would need to deploy the application on a real Windows Phone device.