Hello All, I'm back again. I know that updates have been more than a little sparse, but I'm doing my best to try and keep up with everything. I'm definitely still trying to get a handle on this blogging thing.
So I did want to get a post out, and am going to be working on getting more posts out soon but in the mean time I thought I'd post about something that I've been working with a lot, and that's TinyIoC.
As many developers already know the idea of Dependency Injection and Inversion of Control has really taken the development world by storm over the past few years. And to anyone who has worked with it at all, it really shouldn't be that surprising. The basic idea of Dependency Injection is a relatively simple one. We decouple our code by using interfaces and a construct called a "Container" to swap out those interfaces for a concrete class.
I'm not going to go into a lot of detail about Dependency Injection, that's a whole big blog post for another time. But the real strength is that we can have our classes exists 100% detached from one another, and then use these containers to swap out interfaces for the appropriate classes.
There are lots of reasons that this idea can be beneficial. For one, it makes unit testing a WHOLE lot easier. Because now we can swap in test versions of the classes that are being used within a class and focus on testing only one unit at a time. Another benefit is that it makes our code a whole lot more maintainable, cause if we need to build a new class we can, and just point the container at it instead of the old class and the container takes care of the rest.
But what I wanted to talk about in this blog post was Dependency Injection with regard to PCLs. Right now I've been doing a lot of work with Xamarin, mainly to build applications in a professional, and a personal setting. And it really is a powerful tool, and it shouldn't be all that surprising that if you want to build an app that is any bigger than a calculator...that you would want some form of dependency injection involved.
But there's the problem, see for you to be able to implement a DI container, in a Xamarin application (for iOS, Android, or Windows Phone), then it has to be PCL Compliant.
For those who aren't aware, PCLs or Portable Class Libraries, utilize a subset of the .net framework to allow us as developers to build reusable class libraries to utilize in our applications. But because its only a subset of the .net framework. Sometimes the dependencies that are required just plain aren't available to us in a mobile setting.
In the case of most of the larger containers out there. For example Castle Windsor, Unity, Ninject, etc. They are not PCL compliant. But after a lot of researching and discussion with other devs, I found a great open source product that fills this need. It's called TinyIoC.
You can find it on GitHub here.
While it may not be as powerful as some of its more robust cousins, it is great for using Constructor Injection, or even manually resolving interfaces within code.
So for those interested, I recommend checking it out. Watch this space...later this week I'll be discussing how to use TinyIoC in an iOS application as well as how to leverage a bootstrap class to handle injection of dependencies at the PCL and then native application level.
Monday, July 21, 2014
Tuesday, July 15, 2014
This is an article I've been wanting to write for a while, and its mainly to voice some observations that I've had in my ten years in the software development industry. In my time, so far in this industry I have been truly lucky enough to have worked on some really fun and exciting projects, and also worked as an adjunct professor for a local university.
Part of my job is assisting in the intern program, as well as helping many junior developers who have just gotten their foot in the door, and are learning to stand on their own. Now, in all of that, I've gotten lots of questions, and honestly a lot of times its the same two questions. The first question is the one most people think of, "How do I get a job in software development?", and that's the question most of my students ask, given that many of them are reaching the end of their tenure at college. The other question is usually the one I get from Junior Developers after they've gotten the all important first job. "How do i succeed in this field?" I've seen many developers come and go, and I've worked with a lot of people I've come to admire in this industry, and the ironic part is that the answer to both questions is the same, and its rarely what you would expect.
Most of my students or junior developers, all have a specific answer in mind when this question is being asked. They are expecting to hear, "If you learn C#, you'll succeed." or "If you master Angular.js, you'll be making 6 figures in no time." But the sad part is that the answer to this in my experience isn't that easily quantifiable. In my experience the course of your career starts with your definition of success. An old saying is that if you want to start something, you should always have an end in mind.
This advice is absolutely timeless, in the sense that anything you do...you should have a goal in mind, something you are hoping to accomplish. So the first thing you need to do, is define success for you.
For me it falls into three categories...Am I employed? Do I enjoy my job? Am I being paid what I think I'm worth?
If the answers to those questions are all yes than I can consider myself successful. The important part here is that you set your own measures of success and make them measurable. Now I know those seem like pretty generic questions, and most people are probably looking at this with a "Come on, your kidding", look about now.
Unfortunately movies and even colleges define success as working for Google or being the next Zuckerberg. But honestly that's a very romantic view of the industry, and it sets many up for failure. It's the same thing where everyone who picks up a guitar isn't going to be the next Jimmy Hendricks.
So instead let's focus on what's attainable. For some of you it might be getting a job at Google. Becoming a manager at your current job, or being self employed. I prefer to think in these almost abstract concepts to help me stay focus on what's important to me.
Now, I know what your thinking, "How does this answer those questions?" the truth is that passion is worth its weight in gold for this industry. There are lots of people out there who can write code, and punch a clock. And in the eyes of many employers, they have training programs where they can teach people with any degree of knowledge how to program the way they want them to. But someone with passion is a rare find. People with passion take it upon themselves to learn this stuff on their off hours, and make staying current a priority, and who bring those insights into their own work. This provides more value, these are also the people who take the most pride in their work, and will do whatever it takes to do the best job they can.
These people are the race horses of our industry, and honestly they are the most sought after. They make the highest salaries, they get the most respect, they get attention from companies like Microsoft and Google, and love their jobs.
So you say, well that's great, but how do I become that person, I'm just a fresh out of school, junior developer. The answer is learn as much as you can whenever you can. If you make it a priority to read up on this stuff on your own time, work on your own personal projects, challenge yourself to do things better or find better solutions to problems, and before you know it you'll find yourself evolving into a passionate developer. And honestly in my experience the rest will fall into place for you.
Now that being said, I don't want to mislead you, this is not easy, its long hours, hard work, and can be frustrating. When your sitting up at night, while others are going to the bar, banging your head against why a grid won't load. You'll be ready to scream, but honestly the pay off is huge. And in my experience that satisfaction you get when you figure it out is amazing.
Now I'm not saying being a shut-in nerd, but what I am saying is take pride in what you do, and work to better yourself at any turn.
Now saying those are your goals is only part of the process. The next step is to make those goals work for you. Cause what's the point in having the goals if you aren't going to ever do anything to get there.
The first thing you really need to do is make those goals a part of your daily life. You need to focus on using these goals to shape your decisions.
So with every question or opportunity, you need to ask yourself, in my case, "Am I enjoying this?", "Will this help me be paid what I'm worth, by being worth more?" or "Is this challenging, or how can I make it challenging?" If you use this method to keep your eye on the price, you will find yourself evolving into a passionate developer.