大家好,今天小编为大家分享关于gg修改器怎么入门_GG修改器入门的内容,赶快来一起来看看吧。
相关概念:监听Listener&回调Callback的区别:
•监听Listener:动态注册addListener() & removeListener(),维护监听ArrayList数组或列表。
•回调Callback:方法调用时,传入callback para,由执行方决定callback的触发条件。
优点:#
缺点:#
java: #
android:#
19、责任链模式(Chain of Responsibility Pattern)–比如:AI语义识别(采用多个场景parse过滤链机制)
Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request.Chain the receiving objects and pass the request along the chain until an object handles it.
使多个对象有机会处理请求,从而避免了请求的发送者和接收者之间的耦合关系 。将这些对象连成一个链,并沿着这条链传递请求,直到有对象处理它为止。
优点:#
缺点:#
java:
• javax.servlet.Filter#doFilter()
android: #
20、解释器模式(Interpreter Pattern)–比如Date和Time格式化显示功能
Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences int the language.
给定一门语言,定义它的文法的一种表示,并定义一个解释器,该解释器使用该表示来解释语言中的句子。
优点:#
缺点:不要在for循环中使用到备忘录模式,会产生大量的数据。
java:
• java.util.Pattern
• java.text.Normalizer
• java.text.Format
android:#
21、备忘录模式(Memento Pattern)–比如:序列化Serializable和Parcelable
Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.
在不破坏封装的前提下,捕获一个对象的内部状态,并在该对象之外保存这个状态,这样以后就可将该对象恢复到原来保存的状态。
优点:#
缺点:不要在for循环中使用到备忘录模式,会产生大量的数据。
java:
•java.util.Date
•java.io.Serializable
•javax.ponent.StateHolder
android:
•Parcelable
22、访问者模式(Visitor Pattern)
Represent an operation to be performed on the elements of an object structure.Visitor lets you define a new operation without changing the classes of the elements on which it operates.
封装一些作用于某种数据结构中的各种元素,它可以在不改变数据结构的前提下定义作用于这些元素的新的操作。
优点:#
缺点:#
java: #
android:#
23、中介者模式(Mediator Pattern)
–比如:MVC(C相当于中介者,减少了M和V之间的耦合)。
Define an object that encapsulates how a set of objects interact. Mediator promotes loose couping by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
用一个中介对象封装一系列的对象交互,中介者使各对象不需要显示的相互作用,从而使其耦合松散,而且可以独立的改变它们之间的交互。
优点:中介者让各个系统之间可以独立,同时又可以交互。
缺点:#
java: #
android:#
以上就是关于gg修改器怎么入门_GG修改器入门的全部内容,希望对大家有帮助。