Libraries & Frameworks

  • Pains of Open Source

    I am a big fan of open source. I use it every day, and recommend it often. But I do want to have a balanced perspective on it. I recently posted about the pleasures of using open source. This is the other side of the coin, the pains of using it.

    My hidden agenda about talking about such problems with open source usage is so that we as a community can come up with solutions to some of these challenges. But first, I really want to hear and write down the main challenges, so that we fix the right problems.

  • The Decline Of Spring?

    I was recently talking to someone I respect very highly about the Spring Framework. I told him that that I would only very reluctantly consider it for a project.

    Now, I have used Spring in the past, and am really a big fan of what they have done. But, these days, I keep thinking of ‘bloated’ in association with them, and wonder if their best days are perhaps behind them.

  • Pleasures of Open Source

    I have been working on deploying a simple web app over the last 2-weeks. The experience has been one that has highlighted how Open Source is changing programming for all of us. First up: the pleasures of open source 🙂

    The goal of the app was to get something very basic and quick out there. I was taking a very simple utility – one that had been built over a day and making it available to everyone. Doing this meant adding what is commonly expected of most apps these days: storing results in a database, adding support for accounts and authentication, and integrating with a couple of external systems to make the utility easier to use.

  • A simple intro to creating a MVC framework: Using GEF

    When creating a rich graphical editor the Model View Controller (MVC) design pattern makes life a lot easier. But it is often difficult to decide which libraries/frameworks to use. On the Eclipse platform GEF (Graphical Editing Framework) is a great solution but it can be challenging to figure out how to integrate with the parts you need. Since GEF is built on top of the Draw2d/SWT graphical libraries and is able to provide a powerful and consistent UI. However there are many considerations and pitfalls to take into account when getting started with GEF.

    Some of my first large scale Java coding involved using and modifying GEF code. Luckily the GEF team provides many helpful examples showcasing the different features GEF offers. I will attempt to provide a concise introduction to the points that I found best helped me understand GEF.

  • Custom Lucene Scoring

    When you have a lot of data, finding what you are looking for can be a challenge. Fortunately, Google and other search engines help us make sense of the vast amount of data on the web. But what about your own data? Lucene is a great tool for indexing and searching large amounts of information quickly. Fundamentally it uses a great deal of intelligence to determine which Documents are most important to you based on your query. On the surface Lucene is easy to set up and provides many useful benefits, and taking a peek under the hood can give us insight into the core of Lucene’s powerful features.

    I have covered the basics of indexing and searching in Lucene. For those of you interested in the internal workings of Lucene there is no better place to start than its scoring system. Lucene’s brain is its Scoring system. This critical calculation is what determines which results are returned from your searches. Depending on the type of data you are indexing and the purpose of your application you may want to implement a custom method of scoring your data. For instance, when searching data about used cars you may want to put more weight on make and model than, say, color.

  • Getting Started with Lucene: Searching your Index

    As humans, we are constantly being bombarded with data throughout our lives. Thanks to the superb filtering and attention abilities of our brains we are able to make sense of all this information. Java programs and web apps need to rely on Lucene for this ability. Using Lucene, apps can now collect information at will, add it to an index, and retrieve whatever information is currently needed quickly and efficiently.

    In my last post we learned the basics of creating and modifying a Lucene Index. Now I’ll give you some tips on how to query your index and avoid some of the pitfalls and stumbling blocks I’ve come across.

  • Getting started with Lucene: Creating an Index

    One of my favorite parts of working at Architexa is that I get the chance to learn and experiment with new and interesting libraries, projects, and tools. One such project is Lucene. It provides a great infrastructure for indexing and searching any sort of text. This can be used for all sorts of applications and has saved us a great deal of time when keeping track of data in our projects.

  • Types of Dependency Injection

    In continuation with my effort of trying to simplify Dependency Injection, I want to elaborate on the different types of injection. Dependency Injection is decoupling an application and service so that the application does not need to know anything about the service implementation. Dependency injection can be broadly classified in three categories: Constructor, Setter and Interface.
    Object dependencies when passed as parameters to a constructor is termed as Constructor Injection.
    <br /> public class Account {<br />   public User user;<br />   public Account (User user) {<br />    this.user = user;<br />   }<br /> }<br /> </p>

    Pico Container is a framework which prefers constructor injection. Constructor injection ensures that the application object is created with all its service dependencies satisfied.

  • Simplifying Dependency Injection

    A lot has been written about Dependency Injection (DI) however, it still remains a complicated topic. The main articles on this topic are quite thorough and provide really good information but in the process, the basic principle behind DI becomes hard to comprehend. DI is in fact fairly simple – its main goal is removal of a class dependency on some code. This class dependency is then ‘injected’ into the code where it is needed. Using dependency injection helps in code maintenance, re-usability, testability, and improves code readability.

    An Explanatory Example

    In one of my projects, we needed to use DI to inject different implementations into a core service. Our project needed to be deployed to multiple types of servers while we wanted to share large portions of the core code and at the same time have different functionality for users.

  • Dependency Injection, Frameworks, and You

    3D Character and Question Mark

    I have previously tried explaining Dependency Injection and how it can be beneficial to any project. This leads us to an important question about whether to use a framework or to do injection manually. Using a framework all the time may not provide you with additional control, rather at times it may further complicate the code. On the other hand implementing dependency injection manually can sometimes become more time consuming and painful. So how do we actually choose?