Skip to content

Commit eaf7255

Browse files
authored
Merge pull request #53 from exceptionless/update-doc
Added documentation about builders
2 parents 28ecfed + 3f20499 commit eaf7255

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Readme.md renamed to README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,31 @@ class ExampleApp{
3232
}
3333
```
3434

35+
**Builder Pattern**
36+
37+
We love our builders!!! This project heavily utilized the use of builders instead of traditional object creation
38+
using `new`. We do this with the help of Project Lombok's `@Builder` annotation. Read more about the
39+
project [here](https://projectlombok.org/features/all). Read more about the
40+
annotation [here](https://projectlombok.org/features/Builder). Read more about the builder
41+
pattern [here](https://refactoring.guru/design-patterns/builder).
42+
43+
_Example: Customizing your Event Queue implementation_
44+
45+
```
46+
EventQueueIF queue = //get your implementation
47+
Configuration configuration =
48+
Configuration.builder().serverUrl("http://your-server-url").apiKey("your-api-key").build();
49+
ConfigurationManager configurationManager =
50+
ConfigurationManager.builder().queue(queue).configuration(configuration).build();
51+
ExceptionlessClient client =
52+
ExceptionlessClient.builder().configurationManager(configurationManager).build();
53+
```
54+
55+
In this library we have made sure that all the values which are not set by builders fallback to reasonable defaults. So
56+
don't feel the pressure to supply values for all the fields. **Note:** Whenever customizing the client
57+
using `ConfigurationManager` never forget to supply your `serverUrl` and `apiKey` using a `Configuration` object as
58+
shown above.
59+
3560
## Spring Boot Users
3661

3762
You can observe `NoClassDefFoundError` in your Spring-boot apps because Spring-boot uses v3 of `OkHttpClient` while this client uses v4. In that case you have to explicitly declare v4 of the library in you `pom.xml/build.gradle`.

0 commit comments

Comments
 (0)