Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liteobject/demo.launchdarkly
This repository contains a demo project illustrating the implementation and usage of feature flags in a .NET application.
https://github.com/liteobject/demo.launchdarkly
csharp depency-inversion dependency-injection facade-design-pattern launchdarkly
Last synced: about 2 months ago
JSON representation
This repository contains a demo project illustrating the implementation and usage of feature flags in a .NET application.
- Host: GitHub
- URL: https://github.com/liteobject/demo.launchdarkly
- Owner: LiteObject
- Created: 2021-05-07T18:26:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T15:10:42.000Z (9 months ago)
- Last Synced: 2024-03-30T16:24:10.008Z (9 months ago)
- Topics: csharp, depency-inversion, dependency-injection, facade-design-pattern, launchdarkly
- Language: C#
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo Feature Flags with LaunchDarkly
## About
This repository contains a demo project illustrating the implementation and usage of feature flags in a .NET application. Feature flags, also known as feature toggles or feature switches, are a software development technique that allows you to enable or disable certain features or functionality in your application without deploying new code.The `Demo.Feature.Flags` project demonstrates how to incorporate feature flags into your codebase, providing a way to control the availability of features at runtime. This approach can be beneficial in scenarios such as:
- Canary releases or gradual rollouts of new features
- A/B testing or experimentation with different feature variants
- Selectively enabling features for specific users, environments, or conditions
- Turning features on or off without redeploying the entire applicationThe project includes examples of how to define feature flags, how to check their status in the application code, and how to manage the configuration and state of these flags. It may also showcase integration with feature management services or libraries that simplify the process of managing feature flags at scale.
By exploring this demo project, developers can learn best practices for implementing feature flags, understand the benefits and trade-offs of this technique, and gain insights into how to incorporate feature flags into their own applications for better control over feature releases and experimentation.
## What LaunchDarkly?
LaunchDarkly is a feature management platform that helps software teams control the delivery of features to their applications. It allows developers to turn features on or off for specific users, segments of users, or for everyone through the use of feature flags.## Decouple our code from their-party libraries
To isolate third-party libraries in our code and make it easier to change vendors, we can use the following approach:
1. __Dependency Inversion Principle__: Instead of directly using the third-party library in our code, create an interface or abstract class that defines the contract for the functionality we need. Then, implement this interface/abstract class using the third-party library.
2. __Dependency Injection__: Instead of creating instances of the third-party library directly in our code, use dependency injection to inject the implementation of the interface/abstract class we created. This way, we can easily swap out the implementation with a different one if needed.
3. __Facade Pattern__: Create a facade class that wraps the third-party library and exposes only the functionality we need. This way, our code only interacts with the facade class, and we can easily replace the underlying third-party library without affecting the rest of our code.By following these principles and patterns, we can decouple our code from the specific third-party library, making it easier to change vendors or upgrade to a new version of the library without having to modify your entire codebase.