Thread: [RomaFramework-dev] Plugin-based development in ROMA?
Brought to you by:
lvca
|
From: ted s. <emo...@ya...> - 2006-09-12 12:16:59
|
Hi All, I have been working on my own ROMA/Naked Objects/EMF - like metadata-based framework for a while. I looked at ROMA a while back and didn't get it. But ROMA has come a long way since then and I want to evaluate it again to see if it meets my own requirements. So far I like a lot of what I see in ROMA, especially like the way that ROMA binds aspects to annotations and ROMA's concept of modules. Anyway, the one requirement that I have, that I am not sure that ROMA can handle, is that I want to develop a plugin-based product. I actually want to build an Eclipse RCP application (I am willing to build an RCP view module for ROMA, that's not a problem). However, I want my application to be extendable by third party plugins in the way that the Eclipse IDE is extendable by plugins. For instance, it should be possible for a third party plugin to dynamically extend the menu system of my ROMA-based application when the plugin is loaded into the application. Let me make the question more specific and refer you to the wiki article on how to create a menu in ROMA, at http://romaframework.xwiki.com/xwiki/bin/view/Doc/Create+menus. It is not clear to me if it would be possible to develop a menu in ROMA that could be extended by a dynamically loaded plugin from a third party. The ROMA documentation states that ROMA creates a menu from a POJO, and by default the pojo's fields and actions are treated as menu items. Question.... Would it be possible to extend this example to dynamically create a menu from an flat text file with menu labels. That is, given a flat text file with the following three lines in it... menu1 menu2 menu3 ...could I dynamically create a menu in ROMA with the three menu items; menu1, menu2, & menu3? If that can be done in ROMA then I know that I could hook ROMA up to the Eclipse plugin-based extension mechanism. Best Regards, and Congratulations on your recent release. You've done a lot of good work on ROMA! Ted Stockwell PS: I suspect that the answer to my question might involve the xml descriptors (maybe I could generate a descriptor dynamically at run time?) But I haven't been able to understand the exact relationship between descriptors, pojos and annotations yet. The ROMA docs could use just a snippet of documentation regarding descriptors. |
|
From: Luca G. <luc...@as...> - 2006-09-12 14:58:41
|
Hi Ted, I'm very glad to listen to proposals about other modules/aspects! Since last releases of Roma you can inject hook inside the Roma = controller. You can register your own org.romaframework.core.flow.UserObjectEventListener implementation to = catch Roma events. To register it: // REGISTER MYSELF AS EVENT LISTENER FROM OBJECTCONTEXT Controller.getInstance().registerListener(UserObjectEventListener.class, myListener); But what you need it's quite different: to define "virtual" class. Namely...Class without a ".class" but definited at run-time. Current = release doesn't support this feature completely. Roma creates a SchemaClass = instance for any Class definition. SchemaClass inherits SchemaClassDefinition. SchemaClassDefinition is unjoined with .class. So I should change some = part of ROMA where uses SchemaClass to use the base abstract SchemaClassDefinition rather. SchemaClassDefinition is what you need. You can build instances at = run-time and register their in the SchemaManager to be viewed by all Roma modules = and aspects. I need to refactor a little bit classes to support full "virtual" class definition. It seems to me an important feature to release before 1.0! Do I have understand correctly your needs? bye, Luca Garulli Blogging on: http://zion-city.blogspot.com http://www.AssetData.it http://www.RomaFramework.org - The new way to build applications http://www.OrienTechnologies.com - Light ODBMS, All in one JDO solution -----Messaggio originale----- Da: rom...@li... [mailto:rom...@li...] Per = conto di ted stockwell Inviato: marted=EC 12 settembre 2006 14.17 A: Rom...@li... Oggetto: [RomaFramework-dev] Plugin-based development in ROMA? Hi All, I have been working on my own ROMA/Naked Objects/EMF - like = metadata-based framework for a while. I looked at ROMA a while back and didn't get it. But ROMA has come a long way since then and I want to evaluate it again = to see if it meets my own requirements. So far I like a lot of what I see in ROMA, especially like the way that = ROMA binds aspects to annotations and ROMA's concept of modules. Anyway, the one requirement that I have, that I am not sure that ROMA = can handle, is that I want to develop a plugin-based product. I actually = want to build an Eclipse RCP application (I am willing to build an RCP view module for ROMA, that's not a problem). However, I want my application to be extendable by third party plugins = in the way that the Eclipse IDE is extendable by plugins. For instance, it should be possible for a third party plugin to dynamically extend the = menu system of my ROMA-based application when the plugin is loaded into the application. Let me make the question more specific and refer you to the wiki article = on how to create a menu in ROMA, at http://romaframework.xwiki.com/xwiki/bin/view/Doc/Create+menus. It is not clear to me if it would be possible to develop a menu in ROMA = that could be extended by a dynamically loaded plugin from a third party. The ROMA documentation states that ROMA creates a menu from a POJO, and = by default the pojo's fields and actions are treated as menu items. Question.... Would it be possible to extend this example to dynamically create a menu from an flat text file with menu labels. That is, given a flat text file with the following three lines in it... menu1 menu2 menu3 ...could I dynamically create a menu in ROMA with the three menu items; menu1, menu2, & menu3? If that can be done in ROMA then I know that I could hook ROMA up to the Eclipse plugin-based extension mechanism. Best Regards, and Congratulations on your recent release. You've done a = lot of good work on ROMA! Ted Stockwell PS: I suspect that the answer to my question might involve the xml=20 descriptors (maybe I could generate a descriptor dynamically at run = time?)=20 But I haven't been able to understand the exact relationship between=20 descriptors, pojos and annotations yet. The ROMA docs could use just a snippet of documentation regarding=20 descriptors. |
|
From: ted s. <emo...@ya...> - 2006-09-13 10:28:03
|
Luca Garulli wrote: > But what you need it's quite different: to define "virtual" class. > Namely...Class without a ".class" but definited at run-time. Current release > doesn't support this feature completely. Roma creates a SchemaClass instance > for any Class definition. SchemaClass inherits SchemaClassDefinition. > SchemaClassDefinition is unjoined with .class. So I should change some part > of ROMA where uses SchemaClass to use the base abstract > SchemaClassDefinition rather. > > SchemaClassDefinition is what you need. You can build instances at run-time > and register their in the SchemaManager to be viewed by all Roma modules and > aspects. > > I need to refactor a little bit classes to support full "virtual" class > definition. It seems to me an important feature to release before 1.0! > > Do I have understand correctly your needs? > I downloaded the ROMA code and took a look at SchemaClassDefinition. Yes! SchemaClassDefinition looks like exactly the kind of thing I need. I will try to implement my proposed extension to the menu example myself. That will be a good way for me to learn more about ROMA. Of course, I will eventually need to pick up the ROMA refactorings to always use SchemaClassDefinition. Thanks, -ted |
|
From: ted s. <emo...@ya...> - 2006-09-22 11:30:04
|
ted stockwell wrote:
> I will try to implement my proposed extension to the menu example
> myself. That will be a good way for me to learn more about ROMA.
>
Hi All,
I have completed a simple extension to the ROMA menu demo that
dynamically extends a menu by adding actions to the menu class at run time.
This demonstrates that ROMA can indeed be extended by plugins.
It turned out that what I wanted to do is in fact amazingly easy. I
just created a new 'aspect' that added the new action to the menu.
The entire code for dynamically adding a menu item at runtime is shown
below.
The code adds a "help" menu item to the main menu of the menu demo.
I'm very impressed by ROMA.
For my next prototype I will attempt to create an Eclipse RCP view
aspect that is capable of running the BLOG demo.
Best Regards,
Ted Stockwell
---------------------------------------------------------
public class HelpUIAspect extends SelfRegistrantConfigurableAspect<String> {
public static final String ASPECT_NAME = "helpui";
public String aspectName() {
return ASPECT_NAME;
}
@Override
public void configClass(SchemaClassDefinition iClass, Annotation
iAnnotation, XmlConfigClassType iNode) {
try {
if (iClass.getSchemaClass().getName().contains("MainMenu")) {
SchemaAction helpAction= new SchemaAction(iClass);
Method helpMethod= this.getClass().getMethod("help", null);
helpAction.configure(helpMethod);
iClass.setAction("this-name-is-ignored", helpAction);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void help() {
}
}
|
|
From: Luca G. <luc...@as...> - 2006-09-22 13:19:28
|
Hi Ted!
I'm very glad to hear news from you. The View Aspect is the more complex
aspect between all others.
I'm excited to see the very first version of your Eclipse RCP Aspect!
Ciao, Luca
-----Messaggio originale-----
Da: rom...@li...
[mailto:rom...@li...] Per =
conto
di ted stockwell
Inviato: venerd=EC 22 settembre 2006 13.30
A: rom...@li...
Oggetto: Re: [RomaFramework-dev] R: Plugin-based development in ROMA?
ted stockwell wrote:
> I will try to implement my proposed extension to the menu example=20
> myself. That will be a good way for me to learn more about ROMA.
> =20
Hi All,
I have completed a simple extension to the ROMA menu demo that =
dynamically
extends a menu by adding actions to the menu class at run time.
This demonstrates that ROMA can indeed be extended by plugins.
It turned out that what I wanted to do is in fact amazingly easy. I =
just
created a new 'aspect' that added the new action to the menu.
The entire code for dynamically adding a menu item at runtime is shown
below.
The code adds a "help" menu item to the main menu of the menu demo.
I'm very impressed by ROMA.=20
For my next prototype I will attempt to create an Eclipse RCP view =
aspect
that is capable of running the BLOG demo.
Best Regards,
Ted Stockwell
---------------------------------------------------------
public class HelpUIAspect extends =
SelfRegistrantConfigurableAspect<String> {
public static final String ASPECT_NAME =3D "helpui";
public String aspectName() {
return ASPECT_NAME;
}
@Override
public void configClass(SchemaClassDefinition iClass, Annotation
iAnnotation, XmlConfigClassType iNode) {
try {
=20
if (iClass.getSchemaClass().getName().contains("MainMenu")) =
{
SchemaAction helpAction=3D new SchemaAction(iClass);
Method helpMethod=3D this.getClass().getMethod("help", =
null);
helpAction.configure(helpMethod);
iClass.setAction("this-name-is-ignored", helpAction); =
=20
} =20
=20
} catch (Exception e) {
e.printStackTrace();
}
}
=20
public void help() {
=20
}
}
-------------------------------------------------------------------------=
Take Surveys. Earn Cash. Influence the Future of IT Join =
SourceForge.net's
Techsay panel and you'll get the chance to share your opinions on IT &
business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
_______________________________________________
RomaFramework-development mailing list
Rom...@li...
https://lists.sourceforge.net/lists/listinfo/romaframework-development
|
|
From: Valerio S. <val...@gm...> - 2006-09-12 15:12:21
|
On 9/12/06, ted stockwell <emo...@ya...> wrote: > > That is, given a flat text file with the following three lines in it... > menu1 > menu2 > menu3 > ...could I dynamically create a menu in ROMA with the three menu items; > menu1, menu2, & menu3? considering the answer Luca provided, it could be possible to generate on-the-fly a simple pojo class, mapping the string definitions in a text file: given its .class, i think the roma internals should be able to proceed with the processing. This could allow txt-based pojo definitions. I can provide the code to do so asap. Luca, what do you think? -- http://valerioschiavoni.blogspot.com http://jroller.com/page/vschiavoni |
|
From: Luca G. <luc...@as...> - 2006-09-12 15:22:06
|
Hi Valerio,
I think it should works! I don't like this solution so much, but it can =
be
useful also for the Roma IDE module. Roma IDE is a light webapp that =
help
you to develop application using Roma. It has a UML Class diagram view =
of
your domain classes and handle annotation and Xml descriptor on the fly.
=20
Roma IDE is now at a proof-of-concept status, but creating class on the =
fly
is what IDE should makes.
=20
Any volounteers for Roma IDE?
=20
For the update for Ted I'll work in these days ;-)
=20
Ciao, Luca
_____ =20
Da: rom...@li...
[mailto:rom...@li...] Per =
conto
di Valerio Schiavoni
Inviato: marted=EC 12 settembre 2006 17.12
A: rom...@li...
Oggetto: Re: [RomaFramework-dev] Plugin-based development in ROMA?
On 9/12/06, ted stockwell <emo...@ya...> wrote:=20
That is, given a flat text file with the following three lines in it...
menu1
menu2
menu3
...could I dynamically create a menu in ROMA with the three menu items;
menu1, menu2, & menu3?=20
considering the answer Luca provided, it could be possible to generate
on-the-fly a simple pojo class, mapping the string definitions in a =
text
file: given its .class, i think the roma internals should be able to =
proceed
with the processing.=20
This could allow txt-based pojo definitions.=20
I can provide the code to do so asap.
Luca, what do you think?
--=20
http://valerioschiavoni.blogspot.com =
<http://valerioschiavoni.blogspot.com>
http://jroller.com/page/vschiavoni=20
|