Category Archives: Web Design

Design To Website, Blog How To Set Up, Google Update Pagerank, Google Crawl, Free Submit Site

Make Java Executable

Make Java ExecutableI’ve been asked many times to show how to make a java program executable. It is actually very easy to make Java executable on any computer.

The main tool you’ll use on a PC is the Command Line or DOS Prompt. To find it click Start and in the box at the bottom type cmd.exe. If you’re on a MAC, just search for terminal in the search box.

I walk through everything in the tutorial video below. If you need any other help, everything follows in text format after the video.

Continue reading Make Java Executable

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

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

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

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

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

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

Builder Design Pattern Tutorial

Builder Design Pattern TutorialWelcome to my Builder design pattern tutorial. You use the builder design pattern when you want to have many classes help in the creation of an object. By having different classes build the object you can then easily create many different types of objects without being forced to rewrite code.

The Builder pattern provides a different way to make complex objects like you’d make using the Abstract Factory design pattern. All of the code follows the video to help you learn.

Continue reading Builder Design Pattern Tutorial

Singleton Design Pattern Tutorial

Singleton Design Pattern TutorialWelcome to my Singleton Design Pattern Tutorial. The Singleton pattern is both easy to understand as well as useful. I’ll demonstrate first how to implement the Singleton pattern. Then I’ll provide and example of its usefulness with a Scrabble example.

Threads can sometimes play havoc with this pattern, so I’ll show you how to avoid those problems. I’ll also review how to use threads, LinkedLists and more.

Continue reading Singleton Design Pattern Tutorial

Abstract Factory Design Pattern

Abstract Factory Design Pattern TutorialHere is my Abstract Factory design pattern tutorial. I also take a second look at the Factory design pattern here as well.

This is considered a hard pattern to understand, but I consider it to be a combination of all you have learned previously. You just need to understand that each step is separated by either a abstract class or an interface. This makes it possible to make extremely flexible objects.

All of the code follows the video and is heavily commented.

Continue reading Abstract Factory Design Pattern

Factory Design Pattern Tutorial

Factory Design Pattern TutorialWelcome to my Factory design pattern tutorial. This is a continuation of my design patterns video tutorial.

You use the Factory design pattern when you want to define the class of an object at runtime. It also allows you to encapsulate object creation so that you can keep all object creation code in one place.

The Factory pattern is presented in many ways to help you learn. Refer to the code that follows the video to completely understand it.

Continue reading Factory Design Pattern Tutorial