You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "yiy27 (Jira)" <ji...@apache.org> on 2022/10/27 02:43:05 UTC

[jira] [Created] (TIKA-3905) Move class TranslatorExample into package org.apache.language.translate, class RecentFiles into package org.apache.tika.metadata

yiy27 created TIKA-3905:
---------------------------

             Summary: Move class TranslatorExample into package org.apache.language.translate, class RecentFiles into package org.apache.tika.metadata
                 Key: TIKA-3905
                 URL: https://issues.apache.org/jira/browse/TIKA-3905
             Project: Tika
          Issue Type: Bug
    Affects Versions: 2.5.0
            Reporter: yiy27
             Fix For: 2.5.0
         Attachments: RecentFiles-java.png, TranslatorExample-java-1.png

*Issue Description*

 

Package _*org.apache.tika.example*_ is a promiscuous package, and groups together miscellaneous functionalities that might be useful to different subsystems. The package structure violates the “high cohesion and low coupling” design rules. I found that Class {_}*TranslatorExample*{_}, and _*RecentFiles*_ are not used by classes in their package{_}.{_} The project has grown larger, leading to becoming increasingly hard to maintain. During the development process, one groups together classes (that often co-change) with similar responsibilities in one package to facilitate maintenance, which prevents a change that causes other packages to be modified. For example, if one modifies package _*org.apache.tika.metadata*_ (i.e., package rename), and forget to change class _*RecentFiles*_ during the maintenance process, there are indirect consequences for the class RecentFiles.

Location: The source file can be found at path File  tika-example/src/main/java/org/apache/tika/example/TranslatorExample.java

tika-example/src/main/java/org/apache/tika/example/RecentFiles.java

 

*Refactoring suggestions*

 

I suggest to move class _*TranslatorExample*_ into package {_}*org.apache.language.translate*{_}, class _*RecentFiles*_ into package {_}*org.apache.tika.metadata*{_}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)