Skip to content

FRQ: Refactoring base and reader class. #132

@zinobelkadi

Description

@zinobelkadi

Proposed new feature or change:

Hello Everyone
I would like to propose a substantial refactoring of the base classes using interfaces and abstract base classes in order to facilitate the future scalability.
First I would suggest the following:

  1. Apply SOLID Principles with Abstract Base Classes with Single Responsibility Principle (SRP):
    -Separate data reading logic from data processing logic
    -Create dedicated classes for each simulation format (LAMMPS, continuum, etc.)
    -Isolate file I/O operations from data validation

  2. Open/Closed Principle (OCP):
    -Design the reader architecture to be extensible for new formats without modifying existing code
    -Use factory patterns for creating format-specific readers

  3. Interface Segregation Principle (ISP):
    -Create specific interfaces for different types of operations (reading, writing, validation)
    -Avoid forcing classes to depend on interfaces they don't use

  4. Error Handling:
    -Implement comprehensive error handling with custom exception classes
    -improve logging throughout the readers for debugging
    -Provide clear error messages for common file format issues

I will in the next few days layout a detailed guideline.

I would be glad to take over this task

ps: Could you add me as a contributor @kay-ro?
Lukas added me to the organisation but not to the repo as a contributor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions