Skip to content

Why use classes/new #49

@wclr

Description

@wclr

You are defining pure configuration using functions why are you using classes and new keywords which is a sign of side effect. It seems excessive and totally unnecessary.

Current config form:

        VPC: new EC2.VPC({
            CidrBlock: NetworkingConfig.VPC.CIDR,
            EnableDnsHostnames: true,
            Tags: [
                new ResourceTag('Application', Refs.StackName),
                new ResourceTag('Network', 'Public'),
                new ResourceTag('Name', Fn.Join('-', [Refs.StackId, 'VPC']))
            ]
        }),

Why no let it be just:

        VPC: EC2.VPC({
            CidrBlock: NetworkingConfig.VPC.CIDR,
            EnableDnsHostnames: true,
            Tags: [
                ResourceTag('Application', Refs.StackName),
                ResourceTag('Network', 'Public'),
                ResourceTag('Name', Fn.Join('-', [Refs.StackId, 'VPC']))
            ]
        }),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions