In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
a. Create a model
Abstract Factory (Abstract Factory)
Javax.xml.parsers.DocumentBuilderFactory
DocumentBuilderFactory instantiates the concrete Factory through FactoryFinder.
Examples of use: DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance (); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder (); Document doc = docBuilder.parse (new File ("xxx.xml"))
Javax.xml.transform.TransformerFactory
Use examples: StreamSource source = new StreamSource (...); StreamSource stylesource = new StreamSource (...); TransformerFactory factory = TransformerFactory.newInstance (); Transformer transformer = factory.newTransformer (stylesource); StreamResult result = new StreamResult (System.out); transformer.transform (source, result)
Javax.xml.xpath.XPathFactory
The structure is almost the same as the previous two.
XPathFactory xpathFactory = XPathFactory.newInstance (); XPath xpath = xpathFactory.newXPath (); XPathExpression expr = xpath.compile (XPATH_EXPRESSION_STRING); Object result = expr.evaluate (Object item, QName returnType)
two。 Generator mode (Builder)
Java.lang.Appendable
Java.lang.StringBuilder#append ()
Java.lang.StringBuffer#append ()
Here we see that state transition operations return objects of the original type, so that the generation chain can be built.
Java.nio.ByteBuffer#put () (CharBuffer, ShortBuffer, IntBuffer, LongBuffer, FloatBuffer and DoubleBuffer)
See the example above.
3. Factory method (Factory method)
Java.util.Calendar#getInstance ()
The constructor of the factory method is on the type to be generated. This abstract factory is very different.
For more information, please see:
Java.util.ResourceBundle#getBundle ()
Java.text.NumberFormat#getInstance ()
Java.nio.charset.Charset#forName ()
Java.net.URLStreamHandlerFactory#createURLStreamHandler (String)
4. Prototype pattern (Prototye)
Java.lang.Object#clone ()
5. Singleton mode (Singleton)
Java.lang.Runtime#getRuntime ()
Java.awt.Desktop#getDesktop ()
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.