tag:blogger.com,1999:blog-3237724005744642470.post8296866912455314163..comments2014-09-05T21:54:37.641+01:00Comments on Captain Debug's Blog: Is Java's String Class a God Object?Roger Hugheshttp://www.blogger.com/profile/07042290171112551665[email protected]Blogger2125tag:blogger.com,1999:blog-3237724005744642470.post-43700607101760108792012-05-04T18:28:21.472+01:002012-05-04T18:28:21.472+01:00I guess String is more an example of Swiss Army Kn...I guess String is more an example of <i>Swiss Army Knife</i> anti-pattern than god object, as the definition of god object implies that it is a central controller that over-centralizes the functionality of the system, making other classes mostly data classes. Obviously String class is not a central controller.<br /><br />Then the question is whether such a Swiss Army Knife is bad? I guess not for most of developers, because we are not maintainers of JDK. In fact, it's kind of handy to have all methods related to String operation in one single class, so every time we want to use a method, we don't need to think: is this a conversion method? or search method? or equivalency method?望尽天涯http://www.blogger.com/profile/01472119419051033549[email protected]tag:blogger.com,1999:blog-3237724005744642470.post-9064226458073430182012-02-27T09:50:22.455Z2012-02-27T09:50:22.455ZJava's JDK is full of crappy code. Have a look...Java's JDK is full of crappy code. Have a look at java.util.Date if you are not convinced yet.<br />So, yeah, definitely a god object. But the funniest of all is that, even being a god object, it still lacks many useful methods... half a god, and not the best half.Loïc Lacombehttp://www.blogger.com/profile/18342295222932568841[email protected]