example

package
v0.0.0-...-05962f3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 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 AbstractFactory

type AbstractFactory interface {
	CreateProduct() AbstractProduct
}

抽象工厂接口

type AbstractProduct

type AbstractProduct interface {
	GetName()
}

抽象产品接口

type ConcreteFactory

type ConcreteFactory struct {
}

具体工厂

func NewConcreteFactory

func NewConcreteFactory() ConcreteFactory

初始化具体工厂对象

func (*ConcreteFactory) CreateProduct

func (s *ConcreteFactory) CreateProduct() ConcreteProduct

具体工厂创建具体产品

type ConcreteProduct

type ConcreteProduct struct {
}

具体产品

func (*ConcreteProduct) GetName

func (c *ConcreteProduct) GetName()

具体产品的方法

Jump to

Keyboard shortcuts

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