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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • The First Annual Recap From JPA Buddy
  • Visually Designing Views for Java Web Apps
  • Exception Handling in Java: Contingencies vs. Faults
  • JobRunr and Spring Data

Trending

  • Performance Optimization Techniques for Snowflake on AWS
  • Kubeflow: Driving Scalable and Intelligent Machine Learning Systems
  • Contextual AI Integration for Agile Product Teams
  • Optimizing Integration Workflows With Spark Structured Streaming and Cloud Services
  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
18.9K 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
  • JobRunr and Spring Data

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!