Design Patterns Used in Eclipse Platform

Here I summarize the design patterns used in Eclipse platform. Understanding design patterns used in Eclipse is the key for understanding Eclipse platform. Eclipse architecture has a clear layered structure. Each layer is independent to each other but interactive with each other. To better understand a framework, it is a good idea to start from … Read more

How to Design a Java Framework? – A Simple Example

You may be curious about how a framework works? A simple framework example will be made here to demonstrate the idea of frameworks. Goal of a Framework First of all, why do we need a framework other than just a normal library? The goal of framework is defining a process which let developers implement certain … Read more

Library vs. Framework?

What is the difference between a Java Library and a framework? The two concepts are important but sometimes confusing for Java developers. 1. Key Difference and Definition of Library and Framework The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in … Read more

Eclipse RCP: Relation between Window, Perspective, View, etc.

This Diagram is from Addison Wesley’s “Eclipse Rich Client Platform 2nd Edition”. It demonstrates the relations between window, menu, perspective, views, etc. In brief, window is the whole application view and it has one page. The page has its own editor and view instances, and uses the perspective to determine its layout. A view is … Read more

The Most Widely Used Java Libraries

Update on 2020/10/07: This list was created nearly 10 years ago. The new list is available here. This article summarizes the most popular and widely used Java libraries for a variety of different applications. 1. Core Apache Commons Lang – Apache’s library that provides a host of helper utilities for the java.lang API, such as … Read more

Trace Source Code in Eclipse: Attaching source to a JAR file

The API document only list the description of class, interface, and methods. If you want to trace back to the original implementation code by clicking “F3” button in Eclipse, then source file need to be attached. The source file under window is here: C:Program FilesJavajdk1.6.0_24src.zip http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/tasks-115.htm

Yet Another “Java Passes By Reference or By Value”?

This is a classic interview question which confuses novice Java developers. In this post I will use an example and some diagram to demonstrate that: Java is pass-by-value. 1. Some Definitions Pass by value: make a copy in memory of the actual parameter’s value that is passed in. Pass by reference: pass a copy of … Read more

What is Aspect-Oriented Programming?

What is Aspect-Oriented Programming(AOP)? By using the diagram below, the concept can be understood in a few seconds. The cross-cutting concerns problem First take a took at the diagram below, and think about what could be the problem. In the diagram above, it is easy to see that log related actions are everywhere. It causes … Read more

Lucene vs. Database Search

Full-text search mechanism

Lucene’s API interface design is relatively generic, which looks like the structure of the database: tables -> record -> field. Many traditional applications, files, and databases can be easily mapped to the storage structure of Lucene / interface. Overall you can see Lucene as a database system to support full-text index.

Read more

Java: Find all callers of a method – get all methods that call a particular method

This tutorial belongs to Eclipse JDT Tutorial Series.

I will explore how we can compute fan in i.e. find all the methods that call a particular method (all callers of a method).

In Eclipse, one can right click on a method and choose “open call hierarchy” and eclipse shows all the methods that call the selected method and all the methods that are called from the selected method (callers and callees of the selected method).

We can programtically find callers and callees and I will explain how I have done it.

There are a couple of different ways that I know:

  1. Use the eclipse JDT internal classes : these are the same classes used by eclipse to show the callers and callees of a method
  2. Use the eclipse ast visitor

Read more

Research Topics for Software Engineering – Between SE and NLP

Someone says that programming language is also a language. This is true. Beyond this, during a software development life cycle different kinds of natural languages are added for various purposes, such as requirement analysis, comments, bug reports, etc. Since there are common features between natural language and software related data, a lot of research in … Read more