开发者

Grouping Java classes

When I'm using Eclipse i work with lots of Java classes (especially when working with abstract factory design pattern) and I need a way to visually group classes bel开发者_C百科onging together (different classes extended or implemented from interfaces get mixed together).

I need a way to group classes that extend the same class or implement the same interface so I don't lose my mental health. I started using Eclipse and Java few day ago, so I'm sure I'm missing something to do what i need...


Have you organized your classes in packages? This is precisely what packages are for. If you organize them in packages, you'll have a nice view of the classes belonging together in the Eclipse Package Explorer.

Further reading:

  • The Java Tutorials: Creating and Using Packages


Import the classes into a UML tool of some kind. There are several free ones out there, including JUDE. Or see if Eclipse has a UML plug-in.


Eclipse has a very handy feature which allows you to see exactly which classes extend (or implement) any class/interface.

Select the superclass/interface/method you are interested in, and press CTRL-T. This will show a popup dialog with the implementing or extending class hierarchy. CTRL-T again will show the super class hierarchy (reverse direction)


You can organize your classes belonging to same event into different packages.for example: com.abc.birds should contain classes related to birds only.com.abc.human should contain all classes related to human only.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜