8000 Some tips for a re-factoring · Issue #50 · rdfio/RDFIO · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Some tips for a re-factoring #50
Open
@mwjames

Description

@mwjames

I know this may not directly merit any functionality provided by RDFIO but if time permits maybe consider the following re-factoring to ease maintenance in future by using some common assumptions about PHP.

  • One class per file
    class RDFIOARC2StoreWrapperException extends MWException {
    }
  • Remove dependency on MWException and use standard exceptions like RuntimeException or classes thereof
  • Move classes (except for scripts) to /src and related sub-directories
    • When moving classes consider using the RDFIO namespace instead of naming each class with RDFIO...
    • Match class names against PSR-4 such as /src/Parser to correspond to RDFIO\Parser\ARC2ToWikiConverter.php
  • For public functions use the public prefix to make visibility more clearer
  • When moving a class try to create a simple unit test to at least cover the constructor (can be extended at any time)
  • For "pure" unit tests avoid MediaWikiTestCase and instead use the standard PHPUnit_Framework_TestCase
  • Documentation such as RDFIOCallGraph.pdf may find a more dedicated location (e.g. /docs)

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

      0