Skip to content

afonsodemori/sevendays-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

7 Days Of Code: Java

7DaysOfCode.io is a webpage maintained by Alura — a Brazilian Technology School — with a set of code challenges divided by technology (languages, frameworks, tools, etc.) so the students can put in practice their knowledge solving 7 challenges, one per day, in the technology they're learning.

This repository is for the Java challenges. Learn more and subscribe at https://7daysofcode.io/matricula/java

Day 1: Consuming IMDB API

On the first day, you will make your Java code consume the IMDB API, fetch the top 250 movies from their list and print the corresponding JSON in the console.

References

Day 2: Parsing the JSON response

On that day, you will parse the JSON response you get from IMDB to extract its information and attributes (such as title, poster, rating, etc).

As and extra, I decided to cache the API response in order to save resources and avoid being blocked by IMDB server due to too many requests. Certainly there are better ways to do that... but I developed my own solution, and I'm proud of it :-)

Screenshot

Day 2: Console output

References

Day 3: Modeling Movie

In today's challenge, the idea will be to model, or at least start modeling your code better. A Movie should have the following attributes: title, urlImage, rating and year.

Also, instead of having several lists (one for each movie attribute), it's much better to organize this into a single List<Movie>, where each movie encapsulates its own data.

References

Day 4: Generating an HTML page

In the day four you're going to generate an HTML page from the list of objects you already have in your Java code. The HTML page will have the information about the movie, including the poster, something like:

Movie information sample

Screenshot

Day 4: Movies list — See this page at https://afonsodemori.github.io/sevendays-java/day-4-movies.html

References

Day 5: Encapsulating our code

Today's challenges are:

  • Encapsulating the API call inside a new class. You can call this class ImdbApiClient.
  • Also, to improve encapsulation and separate all responsibilities into their proper classes, create a new class to parse the JSON.

References

Day 6: Marvel API

Adapt your code to also work with Marvel API. You should make your code more generic and prepared to receive data from other APIs. For this, interfaces come into play, which allow different implementations.

Screenshot

Day 6: Comics list — See this page at https://afonsodemori.github.io/sevendays-java/day-6-comics.html

References