The problem you are facing is not, in my opinion, related to RCP. Its a more architectural problem. Your opinion is connected with business logic and! The decision can be made using two (common) design patterns:
- Model-View-Controler (MVC)
- Model-View-Presenter (MVP)
. MVP.
. , , RCP-, rcp.view. , ( org.eclipse.core.runtime ) rcp.presenter. , .
:
- rcp.presenter
rcp.view(
,
)
- ,
rcp.presenter
.
- rcp.presenter
IPerspective,
(showLogiDialog(), showAdministratorViews ( ), showStandardViews ( ))
- PerspectivePresenter, IPerspective
- rcp.view , IPerspective, presenter = new PerspectivePresenter (this)
- presenter.load() implenent
, ,
:
public void load()
{
User user = view.showLoginDialog();
user.login();
if(user.isAdministrator())
view.showAdministratorViews(user);
else
view.showStandardViews(user);
}
, , -, , . , , -.
, , ( ), . . JFace-Databindings ( ).
, WorkbenchWindowAdisor , . , , / .. (, isAdministrator adminMenu).
, , Eclipse RCP ( ) . . RCP , ... , . MVP ( ). , , .
, , , .