#
Tag: registration
See all tags.
Learn how to register services in Parsley using constructor functions. Understand what constructor functions are in Go and how Parsley uses them to automatically resolve and inject dependencies into your application.
Learn how to use factory functions in Parsley to gain more control over service creation. Discover the difference between factory and constructor functions, and see how factory functions enable dynamic service configuration with additional parameters.
Learn how to use the RegisterInstance
method in Parsley to manually register and manage complex service instances. Ensure consistent state and availability across your application by treating registered instances as singletons, making them accessible to other services as dependencies.
Learn how to group related services with the RegisterModule
method in Parsley to maintain modular code structure. Discover how service modules improve code organization, reusability, and separation of concerns, making your applications easier to scale and manage.
Learn how to use named service registration in Parsley for precise control over multiple service implementations. Discover how to associate unique names with services, configure different contexts, and resolve them dynamically to create a more flexible and adaptable application architecture.
Learn how to register and inject multiple services of the same contract type in Parsley using the RegisterList[T]
method. Simplify service management and gain flexibility by automatically injecting arrays or slices of services that share a common interface or type.
Discover how to manage service instance lifetimes in Parsley through various lifetime scopes. This guide explains the significance of lifetime settings, detailing how they influence the frequency of constructor or factory method calls and the management of service instances in your application.
Explore the concept of lazy proxies in Parsley, a feature that allows for the deferred creation of service instances until they are needed. This guide explains how lazy proxies can optimize performance by managing resource-intensive dependencies effectively.
This article explores the advanced dependency injection capabilities offered by the Parsley CLI through its generate proxy
command. You’ll learn how to automatically generate proxy services and interfaces for your service contracts using //go:generate
annotations.
This article discusses the importance of validating service registrations in Parsley using the built-in Validator
service. You’ll learn how the Validator helps identify critical issues like missing and circular dependencies, which can lead to runtime errors and application crashes.
Official documentation of the Parsley´s "registration" package