Files
Files copied to clipboard
Code Quality: Duplication in DetailsLayoutBrowser, ColumnViewBase and GridViewBrowser
Description
Some code is duplicated between DetailsLayoutBrowser.xaml.cs,
GridViewBrowser.xaml.csand
ColumnViewBase.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
@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.
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.