Skip to content

Refactor god class 'IClassProvider' #6393

@njannink

Description

@njannink

The IClassProvider is an anti-pattern god class. It contains the class building for all components and extensions so on each enhancement on new extension you will need to update this interface and all implementing providers making maintaining it a nightmare and finding logic also complicated.

Would be better to use a decorator pattern like

interface ICssProvider<TComponent>()
{
   IEnumerable<string> GetStyles();
   IEnumerable<string> GetClasses();
}

Then you can implement where needed a CssProvider for specific frameworks and components. Also theming + defaults logic you could then move to these component providers making the components cleaner and easier to maintain.

I know this is a big refactoring maybe for a 3.0 release, but would certainly improve the API and maintainability on the long run.

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