0

I'm just wondering what is good practice when it comes to managing the contributing Class of a Part in Eclipse RCP development? I know that when a Part get's focus in the application it calls the Class that is linked to that Part, and in that Class you can use annotations such as @PostContruct and @Focus to indicate certain behaviours.

What I'm wondering is whether I should be destroying the Class and re-loading it every time the user switches Parts? Is it bad practice if I don't or is there no need to destroy a Class and re-load it every time?

SteWoo
  • 458
  • 1
  • 8
  • 21

1 Answers1

1

The DI framework will control the life cycle of your contribution Class for you and will call the annotated methods as is appropriate. So you don't need to destroy it manually.

Have a look at this tutorial explaining the annotations for Parts: http://www.vogella.com/articles/EclipseRCP/article.html#programmingmodel_annotation

christoph.keimel
  • 1,240
  • 10
  • 24
  • I see! Thanks for the explanation. I had been following the Vogella tutorials but it wasn't 100% clear to me from them :) – SteWoo Feb 27 '13 at 14:21