Documentation
¶
Overview ¶
Package bridge implements the Bridge design pattern. In the context of woodworking projects, the bridge is implemented through dependency inversion. The specific projects (Desk, Chair) are not tightly coupled to a particular tool set (ManualToolSet or PowerToolSet), but instead depend on an abstract interface (ToolSet). Each project conforms to the ProjectBuild interface and inherits from the Project struct, which encapsulates the abstract ToolSet and validation method, allowing for flexible tool swapping without modifying the project logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chair ¶
type Chair struct {
Project
}
Chair is the specific Project that can be built through the bridge to the tool sets
type Desk ¶
type Desk struct {
Project
}
Desk is the specific Project that can be built through the bridge to the tool sets
type ManualToolSet ¶
type ManualToolSet struct{}
ManualToolSet is the concrete implementation of ToolSet interface for the manual working processes
func (*ManualToolSet) Cut ¶
func (s *ManualToolSet) Cut()
func (*ManualToolSet) Drill ¶
func (s *ManualToolSet) Drill()
func (*ManualToolSet) Finish ¶
func (s *ManualToolSet) Finish()
func (*ManualToolSet) Joint ¶
func (s *ManualToolSet) Joint()
func (*ManualToolSet) Plane ¶
func (s *ManualToolSet) Plane()
func (*ManualToolSet) Resaw ¶
func (s *ManualToolSet) Resaw()
func (*ManualToolSet) Route ¶
func (s *ManualToolSet) Route()
func (*ManualToolSet) Sand ¶
func (s *ManualToolSet) Sand()
type PowerToolSet ¶
type PowerToolSet struct{}
PowerToolSet is the concrete implementation of ToolSet interface for the electric instruments operated processes
func (*PowerToolSet) Cut ¶
func (s *PowerToolSet) Cut()
func (*PowerToolSet) Drill ¶
func (s *PowerToolSet) Drill()
func (*PowerToolSet) Finish ¶
func (s *PowerToolSet) Finish()
func (*PowerToolSet) Joint ¶
func (s *PowerToolSet) Joint()
func (*PowerToolSet) Plane ¶
func (s *PowerToolSet) Plane()
func (*PowerToolSet) Resaw ¶
func (s *PowerToolSet) Resaw()
func (*PowerToolSet) Route ¶
func (s *PowerToolSet) Route()
func (*PowerToolSet) Sand ¶
func (s *PowerToolSet) Sand()
type Project ¶
type Project struct {
Tools ToolSet
}
Project is the abstract Project type that stores the specific ToolSet field
func (*Project) CheckTools ¶
func (p *Project) CheckTools()
CheckTools it the validation method for the Tools presence
type ProjectBuild ¶
type ProjectBuild interface {
Build()
}
ProjectBuild defines the abstraction for any woodworking project that can be built using a ToolSet.