en

Packt Publishing

  • Андрей Лунякаmembuat kutipan2 tahun yang lalu
    Lucene is mature, open-source, highly performing, scalable, light and, yet, very powerful. It also has a very strong community that supports it. Its core comes as a single file of Java library with no dependencies, and allows you to index documents and search them with its out-of-the-box full text search capabilities.
  • DDaudalagidmembuat kutipantahun lalu
    Each Python class definition has an implicit superclass: object.
  • DDaudalagidmembuat kutipantahun lalu
    When we define our own class, object is the superclass.
  • DDaudalagidmembuat kutipantahun lalu
    The superclass of all classes, object, has a default implementation of __init__() that amounts to pass. We aren't required to implement __init__(). If we don't implement it, then no instance variables will be created when the object is created.
  • DDaudalagidmembuat kutipantahun lalu
    Refactoring is better than adding if statements.
  • DDaudalagidmembuat kutipantahun lalu
    "Explicit is better than implicit."
  • DDaudalagidmembuat kutipantahun lalu
    In this example, we factored the __init__() method into the superclass so that a common initialization in the superclass, Card, applies to all the three subclasses NumberCard, AceCard, and FaceCard.
  • DDaudalagidmembuat kutipantahun lalu
    A small domain of static objects may be part of implementing a Strategy or State design pattern.
    In some cases, we may have a pool of constant objects created in an initialization or configuration file, or we might create constant objects based on command-line parameters.
  • DDaudalagidmembuat kutipantahun lalu
    This can make the Strategy or State design patterns work efficiently by reusing objects from a small, static pool of constants.
  • DDaudalagidmembuat kutipantahun lalu
    We define a function that creates objects of the required classes.
    We define a class that has methods for creating objects. This is the full factory design pattern, as described in books on design patterns. In languages such as Java, a factory class hierarchy is required because the language doesn't support standalone functions.
fb2epub
Seret dan letakkan file Anda (maksimal 5 sekaligus)