Interpreter Design Pattern Tutorial

Interpreter Design Pattern TutorialWelcome to my Interpreter Design Pattern Tutorial! The Interpreter design pattern is ignored by most, but in this tutorial I’ll show you how to do some cool things with it.

In top of that, I’ll also answer all of the recent questions I’ve received about both Java Reflection and String manipulation. I found you can do pretty great things if you combine reflection with the interpreter design pattern.

All of the code follows the video and it is heavily commented to help you learn.

Continue reading Interpreter Design Pattern Tutorial

Mac Game Controller

Best Mac Game ControllerI’ve been asked my opinion on the Best Mac Game Controller recently many times, so this weekend I tried a bunch of Mac game controllers out. Even though you may have heard otherwise, the XBox 360 controllers and the off brand versions don’t work consistently.

After trying 5 Mac game controllers, the best for the Mac is the PS3 Dualshock 3 Wireless. It connects effortlessly with the help of the Gamepad Companion 2.4, which you can download here for free. The only other thing you need is a USB 2.0 A to Mini-B Cable for charging you controller. Everything else you need to do is covered in the video below.

Continue reading Mac Game Controller

Chain of Responsibility Design Pattern Tutorial

Chain of Responsibility Design Pattern TutorialWelcome to my Chain of Responsibility Design Pattern Tutorial! Wow, that was a mouthful!

This pattern has a group of objects that are expected to between them be able to solve a problem. If the first Object can’t solve it, it passes the data to the next Object in the chain. In this tutorial, I’ll use it to make the right calculations based off of a String request. While that is pretty simple the capabilities of this pattern are endless.

The code follows the video to help you learn.

Continue reading Chain of Responsibility Design Pattern Tutorial

Proxy Design Pattern Tutorial

Proxy Design Pattern TutorialWelcome to my Proxy Design Pattern Tutorial! The Proxy design pattern limits access to just the methods you want made accessible in another class.

It can be used for security reasons, because an Object is intensive to create, or is accessed from a remote location. You can think of it as a gate keeper that blocks access to another Object. I demonstrate how the proxy pattern works using some code used in my State Design Pattern Tutorial. You may want to check that tutorial out before proceeding.

Continue reading Proxy Design Pattern Tutorial

State Design Pattern Tutorial

State Design Pattern TutorialWelcome to my State Design Pattern Tutorial! I explain how the state pattern is used by using it to simulate an ATM machine.

I explain how you come to decide on the different states. I then show you how to design the interface that each state will use. We think about the methods that are needed for every class that implements the interface then.

All the steps are looked at from many directions and the code below will fill in the gaps.

Continue reading State Design Pattern Tutorial

Easy Veggie Burger Recipe

Easy Veggie Burger RecipePreviously I showed you my black bean veggie burger recipe and this time I’ll show you my easy veggie burger recipe. I actually prefer the taste of this recipe and it is much cheaper. It costs about 50 cents a burger!

I started experimenting with veggie burger recipes a while back because they were so expensive. Most recipes you find online also take forever, or fall apart. Not this one!

It comes in at just 136 cal. 3 g fat, 12 g protein and 4 g sugar. The recipe follows the video.

Continue reading Easy Veggie Burger Recipe

Flyweight Design Pattern Tutorial

Flyweight Design Pattern TutorialWelcome to my Flyweight Design Pattern Tutorial! The flyweight design pattern is used to dramatically increase the speed of your code when you are using many similar objects.

To reduce memory usage the flyweight design pattern shares Objects that are the same rather than creating new ones. In this tutorial, I’ll create 100,000 rectangles and show you the difference in speed versus creating unique rectangle objects versus the flyweight design. The code follows to help you learn.

Continue reading Flyweight Design Pattern Tutorial

Composite Design Pattern Tutorial

Composite Design Pattern TutorialWelcome to my Composite Design Pattern Tutorial! The Composite design pattern is used to structure data into its individual parts as well as represent the inner workings of every part of a larger object.

The composite pattern also allows you to treat both groups of parts in the same way as you treat the parts polymorphically. This allows your objects to maximize complexity while also remaining dynamic.

All of the code follows the video to help you learn. It is heavily commented.

Continue reading Composite Design Pattern Tutorial

Iterator Design Pattern Tutorial

Iterator Design Pattern TutorialWelcome to my Iterator Design Pattern Tutorial! The iterator design pattern allows you to access objects that are stored in many different collection types.

You do this by creating a common interface that these classes share. Then you have them provide you with an iterator that allows you to traverse the objects they contain.

Because they all share a common interface you can treat them polymorphically and eliminate a lot of duplicate code. The example video will explain how and the code that follows will reenforce the concepts.

Continue reading Iterator Design Pattern Tutorial

Healthy Pork Chop

Healthy Pork ChopToday I’ll show you how to make a healthy pork chop! A normal pork chop is: 286 Calories, 18 G of Fat and 93 mg of Cholesterol. Mine in comparison is only 120 Calories, .5 G of Fat and 0 Cholesterol.

Just like I did in the past, I’ll make this breaded pork chop with a meat alternative called Seitan. This video also could be called how to make seitan. Seitan is a meat alternative that has the same texture as meat and if prepared right it will taste just like a pork chop in this situation. The recipe follows the video.

Continue reading Healthy Pork Chop

Template Method Design Pattern Tutorial

Template Method Design Pattern TutorialWelcome to my Template Method Design Pattern Tutorial. It is an extremely easy design pattern to understand and use.

With this pattern, you define a method (algorithm) in an abstract class. It contains both abstract methods and non-abstract methods. The subclasses that extend this abstract class then override those methods that don’t make sense for them to use in the default way.

It may sound complicated, but it definitely isn’t. It is also extremely useful. Look at the code after the video to get a complete understanding quickly.

Continue reading Template Method Design Pattern Tutorial

Healthy Sausage

Healthy SausageToday I do the impossible! I show you how to make Healthy Sausage! Now by healthy sausage, I mean it tastes like sausage and it has the same texture as sausage. It is however made from Textured Vegetable Protein instead of pork and the other random things you find in unhealthy sausage.

My healthy sausage patties are 158 calories each. They have 9 Grams of Fiber (50% requirements), 14 Grams of Protein (30% requirements) and only 3 Grams of Fat (.05% requirements). Your average unhealthy sausage patty is 230 Calories with 198 of those Calories coming from Fat! My sausages are even healthier than normal veggie patties!!!

Continue reading Healthy Sausage

Bridge Design Pattern Tutorial

Bridge Design Pattern TutorialWelcome to my Bridge Design Pattern tutorial. If you ever wanted to build a group of classes that slowly added functionality from one class to the next, this is the design pattern for you.

There seems to be a lot of confusion in regards to what constitutes a bridge design pattern in both books as well as online. In this tutorial I will show you how it was explained to me and the ways in which I have found it is useful.

The code after the video goes into greater detail if you’d like to check that out.

Continue reading Bridge Design Pattern Tutorial

Facade Design Pattern Tutorial

Facade Design Pattern TutorialWelcome to may Facade Design Pattern Tutorial! The Facade pattern is extremely easy to understand. Chances are you have used it already and just didn’t know it.

The Facade pattern basically says that you should simplify your methods so that much of what is done is in the background. In technical terms you should decouple the client from the sub components needed to perform an operation.

All of the code that follows the video will fill you in on anything you don’t catch in the video.

Continue reading Facade Design Pattern Tutorial

Adapter Design Pattern Tutorial

Adapter Design Pattern TutorialWelcome to my Adapter Design Pattern Tutorial! This is a very easy design pattern to grasp and put into use.

This pattern is used when you want to translate one interface of a class into another interface. Now, it makes sense that these 2 interfaces are compatible otherwise the pattern may not make sense. To accomplish this, all you need to do is bridge the differences using our old friend composition again.

Watch the video and look at the code below and you’ll get it.

Continue reading Adapter Design Pattern Tutorial

Delicious Healthy Sandwich

Delicious Healthy SandwichIs there any quest worth more than the quest that leads you to a delicious healthy sandwich?

How delicious? How about a meat loaf hoagie? How healthy? How about a sandwich that clocks in at just 300 calories, with 1 gram of fat, 23 grams of protein and only 8 grams of sugar!

On top of all that it is extremely cheap! The sandwich is mainly texturized vegetable protein and it costs only $2 for 10 oz. You know you want it! The recipe follows the video.

Continue reading Delicious Healthy Sandwich

Command Design Pattern Tutorial

Command Design Pattern TutorialWelcome to my Command Design Pattern Tutorial! The Command design pattern allows you to store a list of commands for later use. With it you can store multiple commands in a class to use over and over.

I cover the basic pattern in numerous ways including descriptions, diagrams and code. We look into executing commands on numerous objects. We also explore how to undo commands.

All of the code follows the video. Between it and the video you should be an expert on the Command Pattern.

Continue reading Command Design Pattern Tutorial

Decorator Design Pattern Tutorial

Decorator Design Pattern TutorialWelcome to my Decorator Design Pattern Tutorial. The Decorator allows you to modify an object dynamically. You would use it when you want the capabilities of inheritance with subclasses, but you need to add functionality at run time.

It is more flexible than inheritance. The Decorator Design Pattern simplifies code because you add functionality using many simple classes. Also, rather than rewrite old code you can extend it with new code and that is always good.

Continue reading Decorator Design Pattern Tutorial

Java Reflection Video Tutorial

Java Reflection Video TutorialWelcome to my Java Reflection Video Tutorial! I’ve been asked many times to cover Java Reflection lately and in this tutorial I’ll show you pretty much everything you can do with Java Refelection.

Many people are confused by reflection because they think it is a concept or technique. Java Reflection is an API and as soon as you know that it becomes easy. The Java Reflection API is used to manipulate classes and everything in a class including fields, methods, constructors, private data, etc. And, in this tutorial you’ll learn it all!

Continue reading Java Reflection Video Tutorial

Prototype Design Pattern Tutorial

Prototype Design Pattern TutorialWelcome to my Prototype Design Pattern Tutorial. The Prototype design pattern is used for creating new objects (instances) by cloning (copying) other objects.

It allows for the adding of any subclass instance of a known super class at run time. It is used when there are numerous potential classes that you want to only use if needed at runtime. The major benefit of using the Prototype pattern is that it reduces the need for creating potentially unneeded subclasses.

All of the code follows the video to help you learn.

Continue reading Prototype Design Pattern Tutorial