Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I've recently (an hour ago) started a project for making a wrapper for Imgur's API using the REST client Retrofit.

I've only implemented a single endpoint so far as I'm questioning my design. While I've been programming in Java for some time now, I'm only now taking my first class in high school, so I've been kinda winging designs in the past and trying to get better at them now.

I'm specifically questioning the contents of the response package.

I just pushed the project on Github, the project is currently less than 150 lines of code so it should be pretty easy to look through.

https://github.com/Rabrg/imgur-api

Response:

package me.rabrg.imgur.response;

import me.rabrg.imgur.response.model.Model;

public class Response<M extends Model> {

    public M data;

    public boolean success;
    public int status;
}

Model:

package me.rabrg.imgur.response.model;

public abstract class Model {
}

Image:

package me.rabrg.imgur.response.model;

public class Image extends Model {

    public String id;
    public String title;
    public String description;
    public long datetime;
    public String type;
    public boolean animated;
    public int width;
    public int height;
    public long size;
    public int views;
    public long bandwidth;
    public String deletehash;
    public String name;
    public String section;
    public String link;
    public String gifv;
    public String mp4;
    public String webm;
    public boolean looping;
    public boolean favorite;
    public boolean nsfw;
    public String vote;
    public String account_url;
    public String account_id;
}
share|improve this question
1  
Welcome to CodeReview.SE! Just two things: An empty abstract class Model is unnecessary, and your code here is only a value object (loosely speaking), therefore I see no meaningful code to review. Perhaps there are other parts of your project that you would like a review on? –  h.j.k. Mar 3 at 2:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.