Entries Tagged ‘object-oriented’

Design patterns – Part 11: Bridge pattern

In part 11 of Design pattern series we will go into creating and using the Bridge design pattern. It is moderately used and uses encapsulation, inheritance and aggregation to separate responsibilities into other classes. The Bridge pattern decouples an abstraction from its implementation so that the two can vary independently.

Design patterns – Part 10: Builder pattern

In part 10 of Design pattern series we will take look at Builder design pattern. Albeit much similarity, this pattern it is not to be mistaken with Abstract factory pattern. As Abstract Factory emphasizes a family of products and returns the product immediately, Builder focuses on constructing complex object step by step, returning product in […]

Design patterns – Part 9: Mediator pattern

This week, I present to you not much used, but quite useful Mediator pattern. Mediator pattern provides a unified interface to set of interfaces in a subsystem. Or, to simplify… Mediator pattern is mediator for communication between several classes.

Design patterns – Part 8: State pattern

State pattern is probably most used in review cycles. The definition says: State pattern allows an object to appear as it can change its class by altering its behaviour and state. What are you talking about? Well, imagine you are in need to build a bug tracking database.  Bug reports in basics have four states. […]

Calling Java classes from LotusScript

Have you ever wondered how you could call already written and quite useful Java classes in your LotusScript code? To me, this moment was, when I was trying to implement other department’s code into my own. Unfortunately I wasn’t skilled enough in ways of object development, LS2J  and googling back then to actually figure out […]

Design patterns – Part 7: Template method pattern

In this article, I would like to present you a design pattern that is not so common, but for sure, I wish, that in the past I would have used it. It would certainly make my life much easier. So, what is this Template method pattern all about? The Template Method Pattern defines the skeleton […]

Design patterns – Part 6: Observer pattern

One of the most used patterns is also a pattern that hears by the name Observer. What does it do? Well, imagine you have a stock portfolio and you need to notify your investors every time the value of their stock changes. First, your investors need to subscribe to the stock they would like to […]

Design patterns – Part 5: Adapter pattern

Another quite useful pattern is Adapter pattern. Adapters represent an interface between two different classes. For example imagine being a continental EU citizen travelling to UK. For you to plug in to UK power plug, you need an adapter that will take the interface your connector has and output the interface UK power plug demands.

Design patterns – Part 2: Decorator pattern

For those, skilled in Java development, Decorator patterns are nothing new, as they are quite common in Java, i.e. FileInputStream with it’s decorator BufferedInputStream class. The definition says: The Decorator Pattern attaches additional responsibilities to an object dynamically. More theoretical background can be found on Wikipedia.

Design patterns – Part 1: Strategy pattern

One of the simplest and most commonly used patterns is definitely strategy pattern. We cannot pass a boring definition, so here you go: The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy algorithm vary independently from clients that use it. You will find out that all strategy pattern […]