example

package
v0.0.0-...-8d22ec3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractClass

type AbstractClass struct {
	AbstractClassInterface
}

抽象类

func NewAbstractClass

func NewAbstractClass(aci AbstractClassInterface) *AbstractClass

初始化抽象类对象

func (*AbstractClass) TemplateMethod

func (cc *AbstractClass) TemplateMethod()

模版方法

type AbstractClassInterface

type AbstractClassInterface interface {
	Step1()
	Step2()
	Step3()
}

抽象类接口

type ConcreteClassA

type ConcreteClassA struct {
}

具体类A

func (*ConcreteClassA) Step1

func (cc *ConcreteClassA) Step1()

具体类A的方法1

func (*ConcreteClassA) Step2

func (cc *ConcreteClassA) Step2()

具体类A的方法2

func (*ConcreteClassA) Step3

func (cc *ConcreteClassA) Step3()

具体类A的方法3

type ConcreteClassB

type ConcreteClassB struct {
}

具体类B

func (*ConcreteClassB) Step1

func (cc *ConcreteClassB) Step1()

具体类B的方法1

func (*ConcreteClassB) Step2

func (cc *ConcreteClassB) Step2()

具体类B的方法2

func (*ConcreteClassB) Step3

func (cc *ConcreteClassB) Step3()

具体类B的方法3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL