Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Using static method in DefaultFieldFactory (bad design?)

Petr Prikryl
9 years ago Jun 07, 2012 12:01pm

Why do you use

package com.vaadin.ui;

public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory {
public static DefaultFieldFactory get() {
return instance;
}
public static Field createFieldByPropertyType(Class<?> type) {
public static String createCaptionByPropertyId(Object propertyId) {

inside Singleton Factory- it is really hard to extend these classes.. I think that non static method should be better and could be easy fixed as minor update
PP

Last updated on Jun, 7th 2012
Matti Tahvonen
9 years ago Jun 07, 2012 8:35pm