Programming/Android

[Android Style Guide] Util/Helper/Manager

haeseong5 2020. 6. 3. 13:30

Util/Helper/Manager

  • 특정기능을 수행하거나 상태를 관리하거나 분리되어 동작을 수행하는 클래스에 대한 사용처별 이름을 정의한다.

Util

  • public static void AAA등으로 쓰이는 여러곳에서 사용되는 util성 기능을 보아둔 클래스
  • aa.bb.cc.util 패키지에 모두 모아둔다.
  • 예) DateFormatUtil, PixelUtil, BitmapUtil등

Utils class, is a static class that perform small and repetitive operations on a kind of instance

enum XUtils {
    static methods here
}

 

 

Helper

  • 특정 패키지나 기능에서 한정되어 사용되는 public static void AAA 클래스
  • 공통으로 쓰이지 않고 특정 기능의 코드를 분리하기 위한 용도로 사용한다.
  • 예) NotificationChannelHelper등

Helper class, is a class that can be instantiate and do some business work

enum XHelper implements RequiredInterface {
   INSTANCE;
   // no instance fields.
}

 

Manager

  • 항상 내부에서 instance로 만들어서 관리되는 용도
  • 내부적으로 state 혹은 information을 가지고 있어서 호출한곳에서의 상태에 따라서 관리되는 값을 변경하고 반영하는 작업을 해준다.
  • 예) RegisterStepManager, RegisterCarInfoConfirmManager등

https://stackoverflow.com/questions/12192050/what-are-the-differences-between-helper-and-utility-classes

 

What are the differences between Helper and Utility classes?

How determine how call a class XHelper or XUtils ? To my mind : Helper class, is a class that can be instantiate and do some business work Utils class, is a static class that perform small and

stackoverflow.com

github.com/PRNDcompany/android-style-guide/blob/master/Java.md#utilhelpermanager