The Pattern
class requires you to use it's public static compile()
method in order to create a Pattern
. What is the reasoning behind this? Also, is this a good example of the Factory design pattern?
In the case of Pattern mostly because because
In general, the current wisdom is to favor static factory methods over constructors, especially in API classes.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.