DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • The First Annual Recap From JPA Buddy
  • Visually Designing Views for Java Web Apps
  • Exception Handling in Java: Contingencies vs. Faults
  • IntelliJ and Java Spring Microservices: Productivity Tips With GitHub Copilot

Trending

  • Liquid Glass, Material 3, and a Lot of Plumbing
  • The Documentation Crisis Nobody Sees: Why AI Agents Are Breaking Faster Than Humans Can Document Them
  • Good Data, Bad Metric: A Mutation Testing Pattern for Analytics Engineering
  • Is the Data Warehouse Dead? 3 Patterns From Enterprise Architecture That Answer This Question
  1. DZone
  2. Data Engineering
  3. Databases
  4. Hackathon Java Tools for Developers

Hackathon Java Tools for Developers

Useful tools and practices for Java Hackathons.

By 
Dmitry Egorov user avatar
Dmitry Egorov
DZone Core CORE ·
Jun. 13, 21 · Opinion
Likes (12)
Comment
Save
Tweet
Share
19.6K Views

Join the DZone community and get the full member experience.

Join For Free

article image Hackathon competitions might be one of the most efficient methods to motivate developers to create their own solutions. Meanwhile, now not many developers are not familiar with such events and how to prepare for them. In this article, I'll explain what tools can simplify your development process as well as increase your chance to win.

What's A Hackathon?

The idea of a hackathon is to deliver an application that has to solve one of the problems in a given field within 24/48h. Often competition organizers notify participants about the hackathon subject. So in most of the cases process has the next steps:

  • Come to the event and assemble your team (or bring yours).
  • Decide with the team what application to write.
  • Deliver that application within the given time. Often it's limited by 24/48h.
  • Win or Lose.

To Be Prepared Is Half the Victory

Quite often the winners of the hackathon are much better prepared than anyone else. Some dishonest participants even write applications before they come. But in this article, we review "legal" preparations.

Most Classical Enterprise Java App Structure

The easiest way to save a lot of time during the competition is to make a skeleton of the classical Java Enterprise app. Quite often an enormous amount of time is wasted on configuration, etc. So let's construct the most common Java EE application structure:

Most Common Java EE Application Structure

UI or User Interface

For the vast majority of projects, it's a mandatory part. UI shouldn't be fascinating but functional. Obviously, for quick prototyping, you need a framework or library with ready-to-go components. Personally, I would recommend React and quite a popular React library: material UI. Material UI library has the most popular components /

Material UI Overview Screenshot

UI Java Frameworks

As a good alternative, you can use frameworks that generate create Javascript UI from Java. The most popular are: Vaadin, ZK, GWT

UI Java Frameworks

HTTP API or Way to Communicate With UI

HTTP communication is not the only one, for some projects we have to use websockets to arrange quick communication. Here we can review useful tools for quick HTTP API building. There are many tools and solutions but I recommend using Spring Boot Web. It allows you easily convert/parse HTTP requests with many other useful features.

Spring Boot Web Example Screenshot

Business Logic

Well, it's a pretty vague definition. But in practice, the business layer is a layer that combines any other layers like services or database repositories. So the key tool here is Dependency Injection and Inversion of Control patterns.  You might use different DI/IOC providers like Google Juice or even write your own but I would recommend Spring Framework once again.

Business Logic Using Spring Framework

Services

In the previous paragraph, we mentioned DI and IOC patterns allow us to inject/replace logic easily. But where to get services themselves? Well, these are a set of options:

Clouds API

Clouds provide tons of different APIs from voice recognition to machine learning tools. I can't favorite any existent one, but I assume the most popular are: AWS, Google Cloud, Azure. They are powerful and paid, so pay attention anytime you use them. So to do not lose all your money, keep logic inside your app that limits API calls.

Cloud API Service Examples

Useful Tools and Libraries

During implementation in order to do not recreate the wheel, you can use different popular libraries like Apache Commons or Guava Collections. You can check this official list from Maven or just check the top 10 articles about that subject. It worth checking this GitHub repo. 

Useful Tools and Libraries Examples

Database Connectivity

The most straightforward but still verbose solution for connecting to your SQL database is JDBC wrappers like apache JDBC template or Spring template. But due to time limitations, they are not useful for Hackathons. The best way to design your DAO quickly is Spring Data. Spring Data has many adapters/solutions for many Data Sources from SQL/NoSQL to more exotic. In this example, we use Spring Data JPA that provides CRUD and query operations for classes — entities from the box! All that you need to do: 

1. Generate class — Entity that matches your table. 

2. Extend Spring Data interfaces and use them!

Java
 
public interface UserDao extends JpaRepository<User, Long> {

    User findUserById(Long id);

}


Spring REST Data

Spring Rest Data solution generates not only CRUD operation for Repository but also exposes it to UI by providing CRUD HTTP endpoints. For example:

Java
 
@RepositoryRestResource
public interface UserRepository extends PagingAndSortingRepository<User, Long> {
    List<User> findByName(@Param("id") Long id);
}


Provide HTTP API to read Users by ID. Once it's implemented next endpoints will be available:

Plain Text
 
{
  "_links" : {
    "users" : {
      "href" : "http://localhost:8080/users{?page,size,sort}",
      "templated" : true
    }
}


Last But Not Least: A Tip About Database Preparation

In order to simplify the database design process, you can use the SqlYog application that allows you to generate schema. Once it's done you can use IntelliJ IDEA to generate entity classes. It might save you billion years. I strongly recommend using these tools! 

Database Preparation: SqlYog and IntelliJ IDEA

JMS or Schedulers or Asynchronous Solutions

You might ask why this part stands separately from business logic or services. Well in general synchronous and asynchronous problems have their own implementations. In most of the cases, Java Messaging is represented by Topic and Queue Pattern and can be solved by RabbitMQ or Active MQ or Kafka, etc. The key problem for all of them is that they require additional configuration in order to run message broker and it's time-consuming. So they still can be used but only there aren't any other options. 

JMS or Schedulers or Asynchronous Solutions Examples

Spring Quartz

Fortunately, most of the async problems can be solved by simple scheduling/triggering patterns. And here Spring provides a nice Quartz solution. 

Spring Quartz Logo

Easy and Quick Deployment: Docker

Docker is a solution not only for quick application deployment but also a magic chest with tons ready to go frameworks. So having it you can easily run preconfigured solutions of any kind.

Docker Logo

Instead of Conclusion

As Miguel de Cervantes once said — "To be prepared is half of the victory". So get prepared my friends and dare to win at hackathons.

Java (programming language) Spring Framework Hackathon Database design dev application intellij Spring Data

Opinions expressed by DZone contributors are their own.

Related

  • The First Annual Recap From JPA Buddy
  • Visually Designing Views for Java Web Apps
  • Exception Handling in Java: Contingencies vs. Faults
  • IntelliJ and Java Spring Microservices: Productivity Tips With GitHub Copilot

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook