私は可能な限りミニマリストになるように努めています。繰り返しが問題です。私はそれが嫌いです。本当に問題になるのはいつですか?
- 静的な使いすぎとは何ですか?
- フィールドメソッドの乱用とは何ですか?
- クラスの乱用とは何ですか?
- 使いすぎの種類は他にもありますか?
問題A:静的を使用するには多すぎる場合はどうなりますか?
private static class Data
{
private static String fileContent;
private static SizeSequence lineMap;
private static File fileThing;
private static char type;
private static boolean binary;
private static String name;
private static String path;
}
private static class Print
{
//<1st LINE, LEFT_SIDE, 2nd LINE, RIGHT_SIDE>
private Integer[] printPositions=new Integer[4];
private static String fingerPrint;
private static String formatPrint;
}
問題B:プライベートメソッドでフィールドデータを取得するには多すぎる場合はどうなりますか?
public Stack<Integer> getPositions(){return positions;}
public Integer[] getPrintPositions(){return printPositions;}
private Stack<String> getPrintViews(){return printViews;}
private Stack<String> getPrintViewsPerFile(){return printViewsPerFile;}
public String getPrintView(){return printView;}
public String getFingerPrint(){return fingerPrint;}
public String getFormatPrint(){return formatPrint;}
public String getFileContent(){return fileContent;}
public SizeSequence getLineMap(){return lineMap;}
public File getFile(){return fileThing;}
public boolean getBinary(){return binary;}
public char getType(){return type;}
public String getPath(){return path;}
public FileObject getData(){return fObj;}
public String getSearchTerm(){return searchTerm;}
関連している