Wintellect Blogs

Dependency Injection Explained via JavaScript

Jeremy Likness

28 Jun , 2014  

When learning a new framework I often find it is useful to examine the source, use the framework, then go into a separate project and build the functionality from scratch to better understand the motivation behind the framework and what it may be saving me by using it. Angular is no exception. There are many tools in the AngularJS toolbox, from data-binding to compiling new HTML tags, but one of my favorites is the built-in dependency injection. You can browse Angular’s DI code here and read my blog posts about understanding Providers, Services, and Factories. A more advanced version is detailed in Interception using Decorator and Lazy Loading with AngularJS.

chimera3sm “Well, Dimitri, every search for a hero must begin with something every hero needs, a villain. So in a search for our hero, Bellerophon, we have created a more effective monster: Chimera.” – Dr. Nekhorvich, Mission Impossible II

I don’t believe I created a monster, but in my search to understand JavaScript dependency injection, I did create jsInject. This library acts as an dependency injection container for JavaScript components that depend on each other. It is based on constructor injection which inverts control of dependencies by passing them in through the constructor.… Read more

, , ,

Wintellect Blogs

WebSockets in Windows Store Apps

Jeremy Likness

26 Jun , 2014  

The WebSockets protocol provides full-duplex communication on top of a TCP connection that is initiated by an HTTP handshake. The fact that it runs over existing HTTP and HTTPS ports allows it to pass easily through most existing firewall configurations. The Windows Runtime provides a powerful set of networking APIs that includes components specifically designed for WebSockets communications. In this article, Jeremy Likness shows how to connect to WebSockets using both message-based and real-time connections from Windows Store apps.

Read the full article at InformIT.com.Read more

Wintellect Blogs

Programming the Windows Runtime (WinRT) by Example

Jeremy Likness

19 Jun , 2014  

In 2011 I heard the first rumors about Windows 8 and knew immediately what my next book would be about. Unlike Designing Silverlight Business Applications that captured years of experience writing Line of Business (LOB) apps in Silverlight, this book would be an introduction to an entirely new platform. My goal was to take what I knew and loved about Silverlight, find its similarities in the new platform, and then highlight what I felt were some amazing developer experiences. It was important to get to market fast, so through several iterations of the Windows 8 releases (including changes to terminology) that required substantial rewrites of content and a rapid release cycle, I managed to release Building Windows 8 Apps with C# and XAML as Windows 8 was released to the world.

showcover_half By necessity, this book introduced developers to the new platform but didn’t dig into best practices (there were none yet) or get very deep (there simply wasn’t time). I vowed to release another book that would fill in the missing pieces and provide a comprehensive overview of the entire Windows Runtime. Because anyone can read the documentation and reference the API, my intent with this book was to make it example-driven and provide thousands of lines of code for you to integrate and use to kick-start your own Windows Store apps.… Read more

Wintellect Blogs

Convert a Windows Store App to the Web in Under 10 Minutes

Jeremy Likness

31 May , 2014  

Microsoft held an event called re//build in Atlanta and I had the opportunity to speak about what’s new with WinJS. The event used a lightning talk format so with only 30 minutes to present, I decided to make the presentation itself the demo. I wrote the re//build WinJS Windows Store app by starting with the JavaScript Grid template and customizing it to generate slides. I also included the open source animate.css library to show transitions. I purposefully went overboard on animations to show how rich the app experience can be despite using HTML.

If you run the app (don’t worry, I’ll give you a link in a minute if you don’t want to build and run it on Windows 8) you’ll see some of the more interesting announcements included future convergence of libraries (right now there are separate libraries for the phone and PC platform) and fresh support for the Xbox. Although those are both cool, what intrigued me the most was the fact that they made the WinJS library open source. What does that mean really? I originally viewed WinJS as a shim between HTML5 and the Windows Runtime, so I couldn’t imagine a scenario where it made sense on the web.… Read more

, , , ,

Wintellect Blogs

An Introduction to Cross-Platform, Cross-Browser WinJs

Jeremy Likness

29 May , 2014  

In case you missed the big announcement, Microsoft has open sourced their Windows Library for JavaScript, otherwise known as WinJS. Many of you may not have noticed this because, like me, you assumed WinJS was just a shim for accessing the Windows Runtime from JavaScript. If this blog were one year older, that would be true, but it’s no longer the case. Although the library was initially built to create Windows 8 experiences, the team has worked hard to expand those experiences to the Windows Phone and finally to the browser itself. That means it provides truly cross-platform, cross-browser experiences. You can build a web-based app using the library and literally run it on your Android browser. It’s that simple.

I covered some of the highlights in my re//Build WinJS Windows Store app that I wrote as a slide presentation using HTML and JavaScript. That app was specifically designed to run on Windows 8.1 so I did not adapt it to the web. To make a web-based example, I had to pull down the WinJS library from GitHub (the instructions to pull it down and build it are on the main page). It was a little strange pulling a Microsoft project via git and then compiling it via grunt, but there you go.… Read more

, ,

Wintellect Blogs

Enterprise Typescript

Jeremy Likness

23 May , 2014  

This past Thursday I had the pleasure of presenting for the Linked In .NET Users Group. The topic was TypeScript. My goal was to show how well TypeScript works to solve common problems in the enterprise to tackle it from the perspective of Return on Investment and how it scales teams, improves productivity, increases quality and reduces overhead. The talk is split between this discussion and hands on examples that cover the semantics while tying them back into the concept of large, parallel teams.

Here is the abstract of the talk followed by the video and deck.

TypeScript is a superset of JavaScript. Designed to enable enterprise-scale application development, TypeScript compiles to pure JavaScript. It provides important features such as classes, modules, and interfaces. TypeScript helps improve the quality of code by generating well-known and widely accepted JavaScript patterns while providing powerful development-time type-checking and discovery. TypeScript runs side-by-side with existing JavaScript and supports the concept of type definition libraries that can describe existing libraries for use by TypeScript even if they are written in pure JavaScript.

In this talk, Jeremy Likness will explore the use of TypeScript in enterprise-scale applications. He’ll discuss not only the technological benefits of TypeScript but also explore the impact to the software development lifecycle overall.… Read more

, ,

Wintellect Blogs

Model-View-ViewModel (MVVM) Explained

Jeremy Likness

24 Apr , 2014  

The purpose of this post is to provide an introduction to the Model-View-ViewModel (MVVM) pattern. While I’ve participated in lots of discussions online about MVVM, it occurred to me that beginners who are learning the pattern have very little to go on and a lot of conflicting resources to wade through in order to try to implement it in their own code. I am not trying to introduce dogma but wanted to pull together key concepts in a single post to make it easy and straightforward to understand the value of the pattern and how it can be implemented. MVVM is really far simpler than people make it out to be.

Why Even Care About MVVM?

Why should you, as a developer, even care about the Model-View-ViewModel pattern? There are a number of benefits this pattern brings to both WPF and Silverlight development. Before you go on, ask yourself:

  • Do you need to share a project with a designer, and have the flexibility for design work and development work to happen near-simultaneously?
  • Do you require thorough unit testing for your solutions?
  • Is it important for you to have reusable components, both within and across projects in your organization?
  • Would you like more flexibility to change your user interface without having to refactor other logic in the code base?
Read more

,

Wintellect Blogs

10 Reasons Web Developers Should Learn AngularJS

Jeremy Likness

24 Apr , 2014  

There is no doubt that AngularJS – the self-proclaimed “superheroic JavaScript framework” – is gaining traction. I’ll refer to it frequently as just “Angular” in this post. I’ve had the privilege on working on an enterprise web application with a large team (almost 10 developers, soon growing to over 20) using Angular for over half of a year now. What’s even more interesting is that we started with a more traditional MVC/SPA approach using pure JavaScript and KnockoutJS before we switched over to using the power-packed combination of TypeScript and Angular. It’s important to note that we added comprehensive testing using Jasmine but overall the team agrees the combination of technologies has increased our quality and efficiency: we are seeing far fewer bugs and delivering features far more quickly.

Executive Summary:

If you are familiar with Angular, this post may give you some ideas to think about you hadn’t encountered before. If you know Angular and are trying to justify its adoption at your company or on your project, this post can provide you with some background information that may help. If you have no idea what Angular is, read on because I’ll share why it’s so powerful and then point you to resources that will get you up to speed, quickly.… Read more

Wintellect Blogs

Silverlight: Where Do We Go From Here?

Jeremy Likness

24 Apr , 2014  

Silverlight made its debut in 2006 with the confusing acronym WPF/E (that’s Windows Presentation Foundation, Everywhere). Indeed the original dream was that a slimmed down version of the .NET Framework could run as a plugin in any browser (including smart phones) and enable developers to wield their weapons of XAML, data-binding, and C# to write line of business apps that would run everywhere. Although it took a few versions to mature, in May of 2011 version 5.0 was released with the features most requested by enterprise users. That was also the year I wrapped up my book about building business applications with Silverlight, titled Designing Silverlight Business Applications (Addison-Wesley, 2012).

In the forward of that book I discussed how the refusal of certain vendors to include the plugin on their smartphones didn’t necessarily mean the demise of Silverlight, but would relegate it to the domain of rich enterprise business applications. HTML5 was still f

ragmented and JavaScript was a very difficult language to scale across large teams and maintain on enterprise projects. Later that year when Microsoft announced their plans for the upcoming Windows 8 operating system, developers around the world took notice of two things: the heavy emphasis on apps written with HTML5 and JavaScript, and the lack of any mention of Silverlight.… Read more

, , , , ,

Wintellect Blogs

Video: A JavaScript Feed Reader in Under 10 Minutes Using Angular JS

Jeremy Likness

23 Apr , 2014  

An

important component of the decision to use a framework should be the amount of ceremony and ritual involved. You must carefully weigh what it takes to ramp up on the technology and how common tasks are performed. It does no good to adopt a library that forces you to solve a problem with more effort than it would take using your basic tools. One of my favorite examples to showcase technology is a simple feed reader. Several years ago I recorded a video to demonstrate how to build a Silverlight MVVM Feed Reader from Scratch in 30 Minutes. It opened a lot of eyes for people who thought MVVM was overcomplicated.

HTML5 and JavaScript have matured significantly and it turns out it is even easier to build a similar application from scratch using tools like Angular (I even throw in some Twitter Bootstrap styling so it looks halfway decent). One of the things I really like about Angular is that it is really doesn’t involve a lot of ritual or ceremony. In fact, in this video I probably take too much time doing things like setting up a title and writing constructor functions instead of just in-lining the code for my controllers and services.… Read more