Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] Annotations vs Events and when should we extend them & Dynamic Menu Items (Bug 389063 and 392903)

Hello Paul, Tom,

first, thanks a lot for your comments and help; regarding the discussion on Bug 389063 and 392903, please let me face this points:

@Tom I see your way of solving the problem, but to gather a deeper understanding, could you please answer the following comments/questions
	- A menu is to consist of both items provided by the application model and dynamic menu items which may unfold into n items. How is it 
	  possible given your lifecycle approach to address these dynamic elements and put them into the right order with elements already provided
	  by the application model or fragments?
	- Where does the cleaning of the rendered menu items happen? S.t. next time the entry is called the elements are fully replaced?	

	I think that your approach is good for any element else as described in your bug, but not in this specific case! I also think that those
	approaches are working on different levels! Adding dynamic items is not a lifecycle thing but merely a contribution of an element which
	unfolds into a managed set of elements!

	So again, I am really in favour of your solution for other elements, and by the way would be happy to discuss this on phone or personal 
	as I see, we are not living too far appart! :)=)

@Paul 
Thanks for your comment in the patch! I will definitely get into each of your points, as it is really important to me that a solution for dynamic
menu items finds its entrance into Kepler!

All the best to you guys,
marco
	



Am 07.11.2012 um 23:33 schrieb Tom Schindl <tom.schindl@xxxxxxxxxxxxxxx>:

> I started exploring this @Lifecycle stuff but made it now more generic
> by using an injection named @Invoke
> 
> You can find my work at
> https://github.com/tomsontom/eclipse.platform.runtime
> 
> Tom
> 
> Am 07.11.12 21:44, schrieb Tom Schindl:
>> Hi,
>> 
>> First of all I think annotation should be used with great care here are
>> the rules I'd set out for when to use them.
>> 
>> * when we need to get return value e.g. to cancel something
>> 
>> * if the information is very tightly scoped to the information provider
>>  and many developers will make use it (performance!)
>> 
>> 
>> IMHO lifecycle is better done with annotations, instead of events and
>> the rest of the lifecycle is already annotation based.
>> 
>> A problem i have with the current annotation based system is that it is
>> very static - we have to invent too many different annotation.
>> 
>> I much more love us to have 1 annotation named @Lifecycle but allow it
>> to hold a meta value @Lifecycle("PROCESS_ADDITION"),
>> @Lifecycle("PRE_SHUTDOWN"), ... and we have another invoke on the
>> ContextInjectionFactory where we pass this meta value.
>> 
>> Such a feature would be very welcome to implement
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=392903 which has to based
>> upon annotation because we need to have a return value, and using the
>> event system is simply to cumbersom because the event is fired for each
>> and every element and the receiver has to skip the processing in 95% of
>> the cases (once more performance!).
>> 
>> Tom
>> 
>> Am 07.11.12 20:12, schrieb Eric Moffatt:
>>> 
>>> While looking at https://bugs.eclipse.org/bugs/show_bug.cgi?id=376821I
>>> realized that we should have some general guidelines for use in similar
>>> situations...
>>> 
>>> My general feeling is that we need to be strict(er) about annotations
>>> since I'm afraid that they'll get out of hand otherwise but I really
>>> don't have a particular metric in mind for deciding which technique we
>>> should use. In the case of the defect above the choice was made easier
>>> since it is clearly a UI Lifecycle event.
>>> 
>>> Can anybody think of a 'rule' for deciding when we should use one versus
>>> the other ?
>>> 
>>> Eric
>>> 
>>> 
>>> _______________________________________________
>>> e4-dev mailing list
>>> e4-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/e4-dev
>>> 
>> 
>> 
> 
> 
> -- 
> B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
> ------------------------------------------------------------------------
> tom schindl                 geschäftsführer/CEO
> ------------------------------------------------------------------------
> eduard-bodem-gasse 5-7/1   A-6020 innsbruck     fax      ++43 512 935833
> http://www.BestSolution.at                      phone    ++43 512 935834
> _______________________________________________
> e4-dev mailing list
> e4-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/e4-dev



Back to the top