List All Pages
This pattern is one level of abstraction higher than Factory Pattern. The abstract factory returns the factory of classes not the classes themselves unlike the factory pattern. Abstract Factories...
An abstract method is a method that is declared, but contains no implementation. An abstract class is a class with one or more abstract methods. Different subclasses may be designed when the...
The values of different instance variables of an object, at a given point of time, constitute its state. The state of an object can be grouped into two categories, public and private. The public...
Sometimes we need to change the interface of a class in order to be usable for a client. This could happen due to various reasons such as the existing interface may be too detailed, or it may lack...
The Aggregate Enforcer (AE) pattern (I have seen debates if this is a design pattern or not) recommends that when an Aggregate object is constructed, it must be constructed in full, that is, all of...
toString public String toString() { return new ToStringBuilder(this,ToStringStyle.SHORT_PREFIX_STYLE). append("offeringPrice", offeringPrice)....
Apache Modules Each apache module (mod_proxy) has a some directives (ProxyPass) Virtual Host Means having more than one server on one machine, as differentiated by their apparent hostname. We can...
Definitions MUA: You construct a message with one or more recipient addresses using a mail user agent (MUA) such as outlook. MTA: Each e-mail client is configured to send mail to a mail transfer...
To make users as Tomcat admins Add the following to tomcat-users.xml <role rolename="manager"/> <user username="reza" password="rezareza" roles="manager"/>
The Bridge Pattern is used to separate the interface from its implementation so that both can vary independently. The normal inheritance of classes from an interface suffers from the following two...
Builder pattern builds complex objects from simple objects step-by-step. The Builder pattern suggests moving the construction logic out of the object class to a separate class referred to as a...
The concept of keeping a copy of an object in some form of memory with the goal of providing a faster response time to a client request is called caching. A cache management strategy must be...
The Chain of Responsibility pattern (CoR) suggests a low degree of coupling between an object that sends out a request and the set of potential request handler objects. The first object in the...
Imaging this: Client —> Invoker —> Service In normal conditions when we want to call a method in Service we need to do this in Invoker: public class Invoker{ if...
Every component or object can be classified into one of the two categories — Individual Components or Composite Components. Composite components are composed of individual components or other...
Declarative Programming Is a programming paradigm that expresses the logic of a computation without describing its control flow. For example, DSLs, SQL, etc. This is in contrast from imperative...
Application objects access different types of constant data items such as data file names, button labels, maximum and minimum range values, error codes and error messages, etc. Instead of allowing...
My contact details can be found on my home page: http://www.RezaGh.com/
The Counting Proxy pattern is useful in designing a set of additional operations that need to be performed before and/or after a client object invokes a method on a service provider object. Instead...
CSS
Basics and Selectors The CSS syntax is made up of three parts: a selector, a property and a value: selector {property:value} for example: body {color:black} The selector is normally the HTML...
MySQL Commands Command Description source file_name Run a script file like a .sql file INSERT into table_name (column1, column2….) values (value1, value2…); insert command mysqldump...
Also known as wrapper, is used to extend the functionality of an object dynamically without having to change the original class source or using inheritance. This is accomplished by creating an...
What is a Design Pattern A design pattern is a documented (semi-)best practice that has been applied successfully in multiple situations to solve a recurring problem. GOF Patterns GOF book has 23...
The Explicit Object Release pattern suggests the idea of releasing external objects when they are no longer needed. In Java we have finalize() method and finally statement.
It hides the complexities of the system and provides an interface to the client from where the client can access the system. The direct interaction of clients with subsystem classes leads to a high...
It is a factory of classes. when we have a super class and some subclasses and we have to return the object of one of the subclasses, we use a factory pattern. Factory Method pattern recommends...
The pattern suggests a mechanism by which you can avoid creating a large number of object instances which have similar content. The Flyweight pattern suggests separating all the intrinsic common...
Hibernate standalone HelloWorld application You can download it from here. Another example using the old hibernate.cfg.xml without entity manager can be downloaded from here. Under src\hibtest we...
If you are allowed to edit pages in this Site, simply click on edit button at the bottom of the page. This will open an editor with a toolbar pallette with options. To create a link to a new page,...
link Tag <head> <link rel="stylesheet" type="text/css" href="theme.css" /> </head> The link tag defines the relationship between a document and an external resource. It is most...
The Immutable Object pattern can be used to ensure that the concurrent access to an object by several client objects does not result in any problem and makes it thread-safe. The Immutable Object...
An object that requests a service from another object is referred as a client object. This type of direct interaction ties the client with a specific class type for a given service request. This...
The Iterator pattern allows you to navigate through a collection of data using a common interface without knowing about the underlying implementation. To accomplish this, the Iterator pattern...
Difference between Forward and Redirect Forward forward is performed internally by the servlet the browser is completely unaware that it has taken place, so its original URL remains intact any...
Basics Entities may either use persistent fields or persistent properties. If the mapping annotations are applied to the entity’s instance variables, the entity uses persistent fields. If the...
Dynamically Changing src Attribute of script I had a situation where I wanted to change the src of a script dynamically before the script runs. Given the following code, we needed to change src...
How to Iterate a Map Iterator it = themap.entrySet().iterator(); while (it.hasNext()) { Map.Entry pairs = (Map.Entry)it.next(); pairs.getKey(); pairs.getValue(); Enhanced For Loop Since...
Please change this page according to your policy (configure first using Site Manager) and remove this note. Who can join? You can write here who can become a member of this site. Join! So you...
JSF
Postback When a user executes a postback, he or she submits the form contained on a page that was previously loaded into the browser as a result of executing an initial request.
JSP
Preface All tags are case sensitive. A pair of single quotes is equivalent to a pair of double quotes. Spaces are not allowed between an equals sign and an attribute value. The elements in a JSP...
What is JSTL (JSP Standard Tag Library) is a collection of JSP custom tags developed by Java Community Process, www.jcp.org. The reference implementation is developed by the Jakarta project,...
This is a quick reference to install my preferred LAMP on Linode VPS. It is not of public interest: Ubuntu Server adduser xxx Add xxx to sudoers using visudo Uncomment more repositories in...
a2enmod Enable/disable or view modules for apache server. acpi Shows battery and thermal information. Try with -t for thermal. adduser/addgroup Add a user or group to the system For example...
Most of the information here apply to Ubuntu but they might work on other Linux distors (such as CentOS) as well. General Hidden files have a '.' before the file name. Most icons are *.svg if you...
My 5 minute Maven startup Set M2_HOME env varibale and set maven\bin into the path. mvn —version A simple maven goal: mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app In the...
Imaging having a number of objects interacting with each other directly. As the number of objects increases, this type of direct interaction can lead to a mess. It also reduces the scope for...
The state of an object can be defined as the values of its properties or attributes at any given point of time. The Memento pattern is useful for designing a mechanism to capture and store the...
My Preference of Order Before Construction Define use cases (use case analysis) — > Estimation —> Identify application interfaces —> Fix high level architecture —> Create...
Monitor pattern is used to solve race condition problem in multi threaded environments. In Java it is implemented using synchronized keyword. An object can have any number of synchronized methods....
The Observer pattern (also called publisher/subscriber) is useful for designing a communication model between a set of dependent objects(observers) and an object that they are dependent on(subject)...
Pattern Name Description More Info Decorator or Wrapper Also known as wrapper, is used to extend the functionality of an object dynamically without having to change the original class source or...
todo have somethings in common with CoR
Services offered by a class are in the form of its methods, which constitute the overall behavior of its objects. But not all methods of a class are always meant to be used by external client...
If the cost of creating a new object is large and creation is resource intensive, we clone the object to avoid creation. Clone is usually a shallow copy wherein the original and the cloned object...
Proxy pattern suggests using a separate object referred to as a proxy to provide a means for different client objects to access the target object in a normal way. A Proxy exists because: Creation...
Contact & Comment Welcome page System Pages Forum Recent posts
There may be a need to have one and only one instance of a given class during the lifetime of an application. public class X { private static X instance; private X(){} //private...
Members: Moderators Admins
Dynamic list binding in Spring MVC http://mattfleming.com/node/134 Validation in MultiActionController This example just works! public class EventValidator implements Validator { public...
The state pattern is also known as objects for states pattern. The state of an object can be defined as the values of its properties,… A typical example is a drawing program in which there is an...
Contact Me Welcome page Site members Recent changes List all pages Page Tags Site Manager Page tags Add a new page edit side panel
The Template Method pattern can be used in situations where there is an algorithm or procedure, some steps of which could be implemented in multiple different ways. In such scenarios, the Template...
Patterns Java Java Tips JPA Webservice Transactions Hibernate Spring Maven Apache Commons Java Tools Apache James Apache Server Tomcat Client...
XA and 2PC An XA compliant driver is a driver that can participate in an XA compliant transaction as defined by the X/Open specification. The XA compliance enables the resources (databases,...
The Virtual Proxy pattern is a memory saving technique that recommends postponing an object creation until it is actually needed. It is a useful pattern when creating an object is expensive in...
The Visitor pattern is useful in designing an operation (method or algorithm) across a collection of objects or a class hierarchy. The Visitor pattern allows the operation to be defined without...
Webservice? Web services combine the HTTP communication protocol and the XML data format SOAP (Simple Object Access Protocol) A framework for exchanging XML-based information in a network. Client...
I write this Wiki mainly for my personal reference to keep these things in one place. If you found it useful then let me know!
According to Wikipedia, the world largest wiki site: A Wiki ([ˈwiː.kiː] <wee-kee> or [ˈwɪ.kiː] <wick-ey>) is a type of website that allows users to add, remove, or otherwise edit...
netstat netstat -b says who is using which port.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License