Answer the question
In order to leave comments, you need to log in
What is the best way to organize a factory method?
The task is this: a factory method is used to determine a specific implementation, something like this:
public static BaseCommand get(String cmd) throws CMDException {
if (All.CMD.equalsIgnoreCase(cmd)) return new All();
...
throw new CMDException(String.format("No suitable command for '%s'", cmd));
}
Answer the question
In order to leave comments, you need to log in
General table of photos and three tables of links with tours, tourists and instructors.
Indicate the type, that is, you have tours, tourists, etc. ... that is, the id transfer is repeated for tourists and tours, but they have different types and make a selection not by id, but by id and type
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question