Aenigma / ActionMockup

Other
1 stars 0 forks source link

Resource form factories are unimplemented #7

Closed Aenigma closed 10 years ago

Aenigma commented 10 years ago

Nearly all the form factory classes are unimplemented. They mostly do not use the correct generics for when implementing ReousrceFormFactory and do not correctly record state. This is a correct implementation for DriverFormFactory that could be used across the other classes.

    public class DriverFormFactory implements ResourceFormFactory<Long, Driver> {
    private final Map<Long, Driver> formMap;
    private transient long count;

    public DriverFormFactory() {
        this.formMap = new TreeMap<>();
        count = 0;
    }

    @Override
    public JResourceForm<Driver> getForm(Long key) {
        return new DriverForm(formMap.get(key));
    }

    @Override
    public JResourceForm<Driver> makeNewForm() {
        this.formMap.put(count, new Driver());
        return new DriverForm(this.formMap.get(count++));
    }
Aenigma commented 10 years ago

Driver form factory implemented in 5d9c81458dda639593c643263caaf6978e0ade02 and classformfactory implemented in af44df3ec56d8c14cd24326f54725833e72054f6.

However, RecurringTransactionFormFactory and TransactionFormFactory are still unimplemented

Aenigma commented 10 years ago

Finished in 420e0b9432c564d40f5eaf55dfc9481ab849f2b9