Hi,
I am creating a software project in which most business objects are stored in files (in a legacy format). The objects will only be instantiated from an inputstream.
I do this today with making the constructor private and instantiating in a static function as follows:
public class BusinessObject {
private BusinessObject() {}
public static BusinessObject fromStream(Stream stream) {
// Do initialization here
}
}
I would like my code to use established design patterns, since other people will be modifying it.
Is this a known pattern, or is there a design pattern that I can use instead of the above?
Thanks,
Martin