On Sun, Apr 22, 2012 at 2:21 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,

I think you should look at the problem from a different perspective.

Browsers used to be expensive, so we always tried to build extensible infrastructures that enabled extensions. This was almost always not good enough because there is always another requirement that is not quite supported.

With Glamour, browsers are not expensive anymore, so the economics changed dramatically. For example, the code in the Moose Panel has exactly 3 little methods. So, instead of trying to find some overly generic mechanism that would enable you to extend the existing browser in some predefined way, you should just build your own browser from scratch.

For the browser part, I am already doing it. I am creating browser in my own class by overriding three methods. Yes. a possible way to create a new Panel is to create it from scratch. The of a new browser does not come from the fact that I am creating a new browser or reusing an old one. The problem occurs because the pragma system defined by MooseFinder is used to construct menus for entities. So, the problem is not just about three methods. Its much more deeper: For customized menus, we need to read pragma header in specific manner to construct customized menus. I dont know what would be the best way to customize menu construction from pragmas, may be a policy object. 

For the moment, I can change default menus by overriding pragmas reading methods but that changes the menus in MoosePanel too.

 

After building more browsers, we will be in a much better position to figure out if we can generalize the exiting infrastructure.

So, would you like to give this path a try?

Cheers,
Doru


On 21 Apr 2012, at 22:05, Stéphane Ducasse wrote:

>
> On Apr 16, 2012, at 6:50 PM, Usman Bhatti wrote:
>
>> Hello,
>>
>> I am building a MoosePanel with customized entities, customized model and, hence customized menus. So, for example, in models pane I would like to display only my own models.
>>
>> For menu items, I am looking to replace existing menus (on models and entities) with my own menus: since the entities in my custom models are particular, current menus cannot be used (some parts can be used e.g. delete a model). I would like to keep the current display/navigation model of the moose panel/moose finder.
>>
>> For my solution, I have started subclassing MooseModel and MooseEntity to be able to describe my customized menus on my models and entities.
>> Customized model integration in Moose Panel was smooth: subclass MooseModel and launch this class from a  MoosePanel subclass (needed to do a resetMeta, though).
>>
>> Customized menus cannot be constructed by simply subclassing MooseModel and MooseEntities because menus are constructed from particular pragmas inside methods of these classes.
>>
>> My solution: I override mooseFinderActions method in my custom model class to populate menus of my model. I works. However, I cannot reuse parts of MooseModel menus that are applicable on my customized model. Similarly, for actions (moosePresentationOrder:) I override methods for customized menu building through pragma reading.
>>
>> My question: Is it the right way to achieve my objectives or should I look somewhere else for the task?
>
>
> may be we should introduce a policy object?
>>
>> tx,
>> usman
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev@iam.unibe.ch
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"From an abstract enough point of view, any two things are similar."




_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev