Speeding Ticket Application I'm looking to get some advice on whether or not I am building/structuring my application the correct way. The program has a few key components:


Calculate the fine based on how fast over the limit a driver was travelling
Generate a fine letter address to the driver
Update a file with a driver's registration details and the fine


So that being said, I have the following classes:


DriverDetails
DriverManager
Fine
FineCalculator
FineType


Here is the idea:

When I want to work out the fine:


FineCalculator object is created
The speed limit is set
The speed of the car is set and then the calculateFine() method is called
The calculateFine() method will return a Fine object, which is a data object which contains an amount, and a string (the result), the points if any, a FineType


This is one side of the application.

The other part is to be done after a fine has been generated. The user will enter the driver details, a DriverDetails object will be created, for the user to then generate any form of documentation it will use the DriverManager object which will take a DriverDetails object when constructed.

The FineCalculator class:

public class FineCalculator {

    private int speedlimit;

    private int carspeed;


    public FineCalculator(int speedlimit, int carspeed) {

        this.speedlimit = speedlimit;
        this.carspeed = carspeed;
    }


    public Fine calculateFine() {

        Fine fine = new Fine();

        int milesover = carspeed - speedlimit;

        if(milesover &lt; 1) { 

            fine.result = "The user was not going above the speed limit, no actions will be taken.";
        }

        else if(milesover &lt; 5) {

            fine.result = "No fine issued, no points gained but a warning will be issued to the driver.";
            fine.finetype = FineType.WARNING;
        }

        else if(milesover &gt; 4 &amp;&amp; milesover &lt; 10) {

            fine.result = "A fine of £50.00 will be issued to the driver. 0 points gained.";
            fine.amount = 50.00;
            fine.finetype = FineType.FIFTY;


        }

        else if(milesover &gt; 9 &amp;&amp; milesover &lt; 15) {

            fine.result = "A fine of £100.00 will be issued to the driver. 0 points gained.";
            fine.amount = 100.00;
            fine.finetype = FineType.ONE_HUNDRED;

        }

        else if(milesover &gt; 14 &amp;&amp; milesover &lt; 20) {

            fine.result = "A fine of £150.00 will be issued to the driver. 3 points gained.";
            fine.amount = 150.00;
            fine.points = 3;
            fine.finetype = FineType.THREE_POINTS_ONE_FITY;
        }

        else if(milesover &gt; 19) {

            fine.result = "A fine of 1000.00 will be issued to the driver, and they will be disqualified.";
            fine.finetype = FineType.DISQUALIFIED;
        }

        return fine;

    }
}


The Fine class:

public class Fine {

    public Double amount;
    public String result;
    public int points;
    public FineType finetype;

}


The DriverDetails class:

public class DriverDetails {

    public String firstname, surname, address, city, postcode;
    public int drivernumber;

}


The DriverManager class:

public class DriverManager {

    private DriverDetails driverdetails;
    private Fine fine;

    public DriverManager(DriverDetails driverdetails, Fine fine) {

        this.driverdetails = driverdetails;
        this.fine = fine;
    }

    public void generateFineLetter() {


    }

    public void updateDriverDetailsWithFine() {


    }
}


And finally, the simple enum class:

public enum FineType  {

    WARNING, FIFTY, ONE_HUNDRED, THREE_POINTS_ONE_FITY, DISQUALIFIED

}


My biggest concern is the fact that I'm not using the getters/setters inside the DriverDetails and Fine data classes. I mean, it doesn't feel like the getters and setters are completely necessary. Am I wrong? I know what I'm doing goes completely against encapsulation, but in this scenario is that bad? Can I have any advice here as to what to improve or if I'm structuring this wrong?
It is a question of how much will the project expand beyond what is described here.  For instance, are you going to persist driver details and other data? if you are going to use a database, then you will probably want to use an Object-Relation-Mapping (ORM) framework, and they tend to expect Java Beans to work with. perhaps you will want to develop a web api that will send or receive such data in json format? json parsers/generators also prefer objects that follow Java Bean standard.

for very simple, small, one-man projects it is probably ok to skip the boilerplate code of getters/setters.  it is just that usually projects tend to grow and expand in time.

another point that can and should be addressed now is the calculator: it feels wrong to me to create instances just to do fine calculation. if we make the analogy to windows calculator, it is like openning a new window each time you want to do a new calculation.  the calculator is stateless: it takes arguments and produces a result. it does not carry any state between calculations.  So I would make the calculateFine() method static and have it accept the two arguments.

another issue is the calculation process itself.  all the attributes of a fine are closely related to each other and come in mutually exclusive sets: the result is a textual description of the enum, the amount and points are also linked to it.  

I would make these values properties of the enum:

public enum FineType
{ 
    NONE("The user was not going above the speed limit, no actions will be taken.", 0, 0), 
    WARNING("No fine issued, no points gained but a warning will be issued to the driver.", 0, 0), 
    FIFTY("A fine of £50.00 will be issued to the driver. 0 points gained.", 50.00, 0), 
    // and so on

    private String description;
    private int    fine;
    private int    points;

    FineType(String description, int fine, int points) {
        this.description = description;
        this.fine = fine;
        this.points = points;
    }

    public String getDescription() { return description; }
    public String getFime() { return fine; }
    public String getPoints() { return p[oints; }
}


now you can have the Fine take a type in the constructor and fill the properties by itself. this makes the calculator process clearer:

public static Fine calculateFine(int speedlimit, int carspeed) {

    int milesover = carspeed - speedlimit;

    if(milesover &lt; 1) { 
        return new Fine(FineType.NONE);
    }
    else if(milesover &lt; 5) {
        return new Fine(FineType.WARNING);
    }
    ...