Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the BaseConstruct #10

Open
ukayani opened this issue Feb 15, 2023 · 1 comment
Open

Using the BaseConstruct #10

ukayani opened this issue Feb 15, 2023 · 1 comment

Comments

@ukayani
Copy link

ukayani commented Feb 15, 2023

Hi, I see that in your patterns lib/template/patterns folder, all the patterns extend the BaseConstruct. Each pattern's props also extend the ConstructCommonProps. What is the best way to create an instance of something like the LambdaSimplePatternProps to pass in to the lambda pattern? If i had to instantiate a LambdaSimplePatternProps by assigning all the fields from ConstructCommonProps, it would lead to a lot of boilerplate code.

I've also noticed in other projects that follow this devops setup, you don't extend BaseConstruct at all, which simplifies the usage of the pattern i think.

@kwonyulchoi
Copy link
Contributor

Thanks for contacting our repository.

In facts, pattern constructs in lib/template/patterns is a set of pre-defined common constructs. It takes a lot of arguments because it does something more for us. So you may feel tired of object creation. But once you learn how to use it, you will be able to use it easily. And since these patterns aren't required, you don't have to use them if you don't need them.

These are examples for creating the construct pattern:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants