Infragistics JQuery controls

Syncfusion Essential Studio for WinRT Beta and Metro Studio product reviews

Syncfusion Essential Studio for WinRT Beta Syncfusion has been a major player in the 3rd party development component market for a while now.  Their products include .NET development UI controls for ASP.NET, ASP.NET MVC, ASP.NET Mobile, WinForms, WPF, Silverlight, and more.  The newest tool release is a suite of controls that are made for Windows 8 WinRT development.  The product is called Essential Studio for WinRT and it's made up of a plethora of highly attractive, cutting edge controls that are specifically designed for WinRT and touch interfaces.   20 Highly optimized controls Syncfusion Essential Studio for WinRT comes with 20 control that are designed with touch control and performance in mind.  The controls are vast and provide everything that you need to developing cutting edge user interfaces for your Windows 8 applications such as dashboards, maps, charts, and more. Microsoft Office document creation from within your WinRT applications The Studio suite comes with controls that allow your application to create Microsoft documents like Word, Excel as well as Adobe PDF documents on the fly.  The controls are completely independent and do not require Microsoft Office or Adobe Acrobat to be installed on the machine.  This is an incredible value which will allow applications to create receipts, invoices, work orders, or any other sort of document that you'd find in a standard line of business application. Samples included As with their other products, Syncfusion has bundled many sample applications (with source code) to help you to get up and running with the tools in no time.  The samples are written in C#/VB.NET and XAML.  Creating Windows 8 Graphics with Metro Studio Syncfusion has also offered a free product called Syncfusion Metro Studio.  Metro Studio is an extremely useful application that provides a huge selection of "Metro" style art snippets that you can edit.  This is a tremendous solution that helps you to add graphics to you Windows 8 applications.  The best part is it's FREE! The artwork is divided into logical groups for you to choose the art that best suites your needs.   When you select a graphic, you are presented with the option to edit the image.  Here you can change the size and color.  You can also preform transformations like rotate.  Syncfusion Metro Studio allows you to output the edited image as standard image files as well as XAML.   As you can see, Syncfusion have provided two extremely useful tools for Windows 8 developers and not only are they first class tools, they are also free! Check them out today! Syncfusion Essential Studio for WinRT Beta  Syncfusion Metro Studio


Mono 3.0 released. New improvements include asynchronous programming, Mac OS X and iOS support, ASP.NET MVC 4, Entity Framework and more

Mono 3.0 released On 10/22/2012 Miguel de Icaza blogged about the latest release of the Mono .NET project.  As you may already know, the Mono project is an open source port of the Microsoft .NET framework which allows cross platform support for .NET applications with support for such systems as Linux and Mac OS X / iOS. The Mono 3.0 release includes improved support for asynchronous programming which was introduced in .NET 4.5.  These improvements help developers to create fast, responsive applications.  The ability to keep the user interface of an application responsive while executing time consuming tasks is extremely important as applications are moving to smart phones and tablets.  The release also includes improvements that will strengthen Mono's support for Mac OS X and iOS development. Developers can also look forward to added support to Microsoft's open sourced stacks which includes technologies like: ASP.NET MVC 4, ASP.NET WebPages, Entity Framework, Razor View Engine, and System.Json. You can read about other improvements to the garbage collector and more here: Miguel de Icaza's blog post http://tirania.org/blog/archive/2012/Oct-22.html The offical Mono project's release notes http://www.mono-project.com/Release_Notes_Mono_3.0  kick it on DotNetKicks.com        


Dependency Injection and Inversion of Control Ioc With the Microsoft Unity Container

Design for Reusability A well designed application should promote code reuse whenever possible.  Code reuse can save you time and money by allowing you to use components from previous applications to solve common problems in new projects.  The task of managing dependencies is one of the many concerns a developer faces when designing for reusability.  Dependencies are any classes that a particular class must directly instantiate and use in order to accomplish a task.  As a rule of thumb, it's good object oriented programming practice to code to an interface rather than a concrete implementation.  This will make your code flexible and built for change.   An example of a dependency You've been tasked to write a console application.  The application requires that the user authenticates before using any of the features and there is a requirement that all successfully log-ins are logged to a text file.  Here is the code for the example. TextLogger.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnityExample { public class TextLogger { public void LogMessage(string message) { //Code to write the message to a text file.... Console.WriteLine(string.Format("Logging the message to a text file: {0} ", message)); } } }   AuthenticationService.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnityExample { public class AuthenticationService { public AuthenticationService() { } internal void Authenticate(string userName, string password) { //Authentication logic goes here TextLogger logger = new TextLogger(); logger.LogMessage("Login was successful"); } } }   Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnityExample { class Program { static void Main(string[] args) { AuthenticationService authenticationService = new AuthenticationService(); authenticationService.Authenticate(); } } } This is a basic example for demonstration purposes only.  Now, as you can see in the AuthenticationService Authenticate method we are instantiating an instance of the TextLogger class.  So now a few weeks pass by and the customer wants you to log to a database instead of a text file.  So you create  a new class. DBLogger.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnityExample { public class DBLogger { public void LogMessage(string message) { //Code to write the message to a database.... Console.WriteLine(string.Format("Logging the message to a database: {0} ", message)); } } } The AuthenticationService was dependent on the TextLogger and is now dependent on the DBLogger class.  The current design requires us to change the AuthenticationService any time the customer requests a new type of logger.  The same holds true for any unit tests that we write that uses a Logger class.  As you can see the design promotes tight coupling because we are coding to a concrete implementation which is not very flexible. Introducing an interface As we can see, both logger classes have one method called LogMessage.  They share the same interface.  This is a perfect example of an instance in which we should code to an interface.  So we start by creating an interface that matches the two logging classes. ILogger.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnityExample { public interface ILogger { void LogMessage(string message); } } Now we could simply change the logger declaration in the AuthenticationService and be done with it, however, there are still some optimizations that can be achieved.  For instance, currently the Logger declaration is a local variable inside of the Authenticate method.  Imagine were to inject the ILogger as a parameter of the AuthenticationService constructor.  This is a much more flexible design because the AuthenticationService only has knowledge of an ILogger.  Since the implementation is injected via the constructor, the class is no longer tied to any one specific implementation. Here is the updated AuthenticationService.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnityExample { public class AuthenticationService { //the logger is now a class field private ILogger logger; public AuthenticationService(ILogger implementation) { //The implementation is injected via the constructor logger = implementation; } internal void Authenticate(string userName, string password) { //Authentication logic goes here logger.LogMessage("Login was successful"); } } } DBLogger.cs updated using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UnityExample { public class DBLogger : ILogger { public void LogMessage(string message) { //Code to write the message to a database.... Console.WriteLine(string.Format("Logging the message to a database: {0} ", message)); } } } The Unity Container The Unity container allows us to use code (or a configuration file) to associate an interface with a class.  This is typically done during your application start up or the set up of your unit tests.  You register your interface and class mappings.  Then later when it's time to instantiate an instance of your objects, you ask the container to resolve an instance of the object that you need.  The Unity container will perform an internal look up and it will resolve any dependencies that your object's constructor depends on.   I prefer to register my interface/class mappings in a class that I call a module.  When my application starts I load all modules to prepare the container to resolve all of the objects that I will need.  This abstraction allows you to easily switch an interfaces implementation at run time providing a high level of flexibility to your code.  Here is a brief example of how to use the Unity container.  You will need to download the Unity assemblies from nuget or from the Microsoft patterns and practices Unity Application block site.http://unity.codeplex.com/ LoggingModule.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Practices.Unity; namespace UnityExample { public class LoggingModule { IUnityContainer _iocContainer; public LoggingModule(IUnityContainer container) { _iocContainer = container; } public void Init() { //Add any logic here to look in a config file, check a property //or any other condition to decide which implementation is registered. //register the database logger to the ILogger interface _iocContainer.RegisterType(typeof(ILogger), typeof(DBLogger)); } } } Updated Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Practices.Unity; namespace UnityExample { class Program { private static IUnityContainer _iocContainer; static void Main(string[] args) { //create our container _iocContainer = new UnityContainer(); InitializeModules(); //the container knows how to create an AuthenticationService object //as well as what type of ILogger it takes because we registered //the required class in the loggerModule. var authenticationService = _iocContainer.Resolve<AuthenticationService>(); authenticationService.Authenticate("username", "password"); Console.WriteLine("press any key"); Console.ReadKey(); } private static void InitializeModules() { //pass the container to the module //so when we register the types we can resolve them var loggingModule = new LoggingModule(_iocContainer); loggingModule.Init(); } } }   This is a very basic introduction to Unity but you I hope that you can see the possibilities when you program to interfaces and let the container take control of object creation.  You could extend this example to create a ModuleInitializer class that takes the modules that need to be initialized.   The bottom line is Program to interfaces Inject dependencies via the constructor Register your dependency interfaces to the desired class in the unity container.  You can use a module approach if you so choose. As long as your interfaces are mapped to classes in your container, the container can resolve any dependencies that your object requires when instantiated. Download the source  UnityExample.zip (723.64 kb) Happy coding! kick it on DotNetKicks.com


Navigation design for Windows Store apps and other Windows 8 design resources

Windows 8 Developer resources If you are a Windows developer then I'm sure you will agree that we are living in a very interesting time.  In light of the launch of Windows 8, Microsoft has launched a very ambitious campaign in an effort to win the interest of developers.  What's most impressive is the amount of developer resources that Microsoft has developed to teach developers how to design and develop applications for Windows 8 and the Windows App Store. I recently ran across a site that dedicated to helping developers create a Windows 8 application and publish to the App store in 30 days.  This Microsoft funded site has divided 30 days into daily tasks and articles that will lead you on the way to developing your first Windows 8 application.  They've even offered a free 1:1 consultation with an expert developer via telephone to assist with development.  They've provided Windows 8 PhotoShop design templates for download, example applications and tons of other design and development resources. The official Windows 8 release is just around the corner but Microsoft has provided a full featured 90 day trial version of Windows 8 for developers to download so they don't have to wait to begin developing their applications.   I think Microsoft is taking all the right steps to get our attention and I'm excited about the road ahead.  I would like to see a little more along the lines of .NET development in the world of Windows 8 as well as more resources for learning WinRT.  In any case, Microsoft, I say kudos to you.  I plan to take advantage of the resources and I will track my 30 day application experience in a series of blog posts.  Stay tuned.   Resources      Dev Center - Windows Store apps  http://msdn.microsoft.com/en-US/windows/apps/br229512   Navigation design for Windows Store apps http://msdn.microsoft.com/en-us/library/windows/apps/hh761500  kick it on DotNetKicks.com        


About the author

My name is Buddy James.  I'm a Microsoft Certified Solutions Developer from the Nashville, TN area.  I'm a Software Engineer, an author, a blogger (http://www.refactorthis.net), a mentor, a thought leader, a technologist, a data scientist, and a husband.  I enjoy working with design patterns, data mining, c#, WPF, Silverlight, WinRT, XAML, ASP.NET, python, CouchDB, RavenDB, Hadoop, Android(MonoDroid), iOS (MonoTouch), and Machine Learning. I love technology and I love to develop software, collect data, analyze the data, and learn from the data.  When I'm not coding,  I'm determined to make a difference in the world by using data and machine learning techniques. (follow me at @budbjames).  

Related links

Month List