Files icon indicating copy to clipboard operation
Files copied to clipboard

Code Quality: Duplication in DetailsLayoutBrowser, ColumnViewBase and GridViewBrowser

Open QuaintMako opened this issue 2 years ago • 1 comments

Description

Some code is duplicated between DetailsLayoutBrowser.xaml.cs, GridViewBrowser.xaml.csandColumnViewBase.xaml.cs`. Sometimes it's entire methods, sometimes it's only partial bits.

These classes are already inheriting from BaseLayout.cs. The duplicated code may be better hoisted inside this class.

Concerned code

  • BaseLayout.cs
  • ColumnViewBase.xaml.cs
  • DetailsLayoutBrowser.xaml.cs
  • GridViewBrowser.xaml.cs

Gains

  • Better maintainability.
  • No need to do the same modifications thrice when we want to add a functionality to the three views.

Requirements

  • Hoist the duplicated code into BaseLayout.cs

Comments

No response

QuaintMako avatar Oct 26 '22 14:10 QuaintMako

@lukeblevins do we want to move ahead with removing duplicate code in this area? It might help future refactoring efforts but I'm not sure if it conflicts with your current work.

yaira2 avatar Oct 26 '22 14:10 yaira2

The current plan of action for the refactorings are as follow:

  • Create a standard layout for the currently existing views ( Done in #10996 )
  • Create a common layour for Details and Grid views to fuse their common code.
  • See what code should be brought down from BaseLayout to StandardLayout (i.e. the code that has nothing to do in the ColumnBlades)
  • Review the logic of the ColumnView and the ColumnBlades to see if the blades logic could be separated from the BaseLayout.
    • If it can be done, see if the existance of the BaseLayout is still required.

QuaintMako avatar Jan 22 '23 15:01 QuaintMako