[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipse-incubator-e4-dev] Initial discussion on the 'modelled' workbench UI
|
Kevin McGuire schrieb:
>>However I don't think we want to be in a position where we have to
devote effort into extending it. Having EMF backing the API means that
all those 'enhancement' requests we get for the
>>model just turn into exposing more of EMF's underlying capabilities.
As long as it's not too costly and we can adequately hide its
implementation details from our clients I think it's a win.
Either way there's effort in extending it. The question is, how often
will we, in what way, and what's the effort for each?
Anyway Eric, given that you're the guy who always talks about the value
in models, and /also/ the guy who always talks about keeping things
clean, simple and minimal, I will really enjoy watching your mental
balancing act as we go through this evaluation process! <g>
I think we all agree that we don't want a bloated model API but my
problem with Eric's implementation is that I loose all things Java
brings to me it terms of tooling, documentation, ... .
If we really take a model first approach the model the model should be
"unbreakable" and the more you give up strong typing the easier it is to
break it (passing incorrect property types, introducing NPE by setting
the model in an invalid state, ...).
Eric's model is perfectly suited for scripting guys but it puts us back
in a world of HashMap's which are flexible but as we all learned are not
suite to hold complex models because human brains work different (at
least mine does).
Compare this codes:
//TODO Eric's Original code // Create the model for the new tab
// ModelElement folderModel = new ModelElement(GuiModel.FID_TABBED);
// folderModel.setProperty(ModelElement.ME_ID, partID);
// folderModel.setProperty(GuiModel.WIDGET_STATE, GuiModel.CS_VISIBLE);
// folderModel.setProperty(GuiModel.CTAB_SHOW_MINIMIZE, new Boolean(true));
// folderModel.setProperty(GuiModel.CTAB_SHOW_MAXIMIZE, new Boolean(true));
//
// // Pseudo-hack...the editor area is visible even if empty
// if ("org.eclipse.ui.editorss".equals(partID)) //$NON-NLS-1$
// folderModel.setProperty(GuiModel.WIDGET_STATE, GuiModel.CS_VISIBLE);
// else
// folderModel.setProperty(GuiModel.WIDGET_STATE, GuiModel.CS_INVISIBLE);
TabbedStack folderModel = presentationmodelFactory.eINSTANCE.createTabbedStack();
folderModel.setId(partID);
folderModel.setState(WidgetState.VISIBLE);
folderModel.setShowMaximize(Boolean.TRUE);
folderModel.setShowMinimize(Boolean.TRUE);
//TODO Eric's Original code // Client Area
// ModelElement clientArea = new ModelElement(GuiModel.FID_CLIENT, "Client Area"); //$NON-NLS-1$
// wbwModel.setProperty(WBW_CLIENT_AREA, clientArea);
// clientArea.setProperty(ModelElement.ME_PARENT, wbwModel);
// wbwModel.addElement(ModelElement.ME_CONTENTS, clientArea);
PerspectiveClientArea clientArea = presentationmodelFactory.eINSTANCE.createPerspectiveClientArea();
wbwModel.setClientArea(clientArea);
In my opinion we need to get the best from both worlds the scripting and
java. As far as I have seen it makeing EMF-Objects scriptable as fairly
easy although I haven't tried it.
The code you see above is my intermediate code and the final EMF model
will also expose the API Eric uses.
Tom
--
B e s t S o l u t i o n . a t EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl leiter softwareentwicklung/CSO
------------------------------------------------------------------------
eduard-bodem-gasse 8/3 A-6020 innsbruck phone ++43 512 935834