Skip to content

Refactor relevant classes to inherit from ResourceBase #299

@johlju

Description

@johlju

The resources are already inheriting from DnsRecordBase which inherits from ResourcePropertiesBase so that we don't need to duplicate properties in every resource, so we already adhere to it. We should still keep that approach. It is like how SqlResourceBase is used. If changing to inherit from ResourceBase we should do that in separate PR and keep the inheriting logic so we don't duplicate resource properties. 🙂

This PR that handles HostNameAlias can either wait for that other PR or change it using current implementation.

@johlju Thank you for your patience and assistance!
Yes, I probably rushed with abandoning the common base class and inheriting directly from ResourceBase.
Using the SqlResourceBase class in SqlServerDsc is a good example worth following.

A minor concern regarding the DnsRecordBase class itself - its structure and functionality resemble ResourceBase ( but out-of-date in comparison with ResourceBase ).

Would it then be possible to proceed as follows?

  • Keep existing resources inheriting from DnsRecordBase.
  • For DnsRecordCname, which is being refactored, make it inherit from a new DnsResourceBase class and move the duplicated Properties we want to avoid into it.

Originally posted by @ahpooch in #298 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions