开发者

Best way to implement a "server" class in Java (Android)

I'm doing an application for Android. One of my classes is Sound which offers methods like playAlarm() and playSong(String name). Whats the best way to implement that kind of class,开发者_开发百科 as an object accessed with a singleton or as a static class with those static methods? From the point of view of app perfomance in Android.


There is probably little difference in performance but using a singleton instead of static methods will make it easier to unit test.

Barry

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜