Thread: [morph-developer] SimpleLanguageBeanReflector
Brought to you by:
orangeherbert,
sgarlatm
From: Matt B. <gud...@ya...> - 2007-02-20 22:07:02
|
I've just implemented a reflector over SimpleLanguage, which is of course itself implemented over the basic reflectors. Trust me, this is going somewhere... Incidentally, the tests for SimpleLanguageBeanReflector implement the long-overdue testing of SimpleLanguage.set(). :) more later, Matt (B) ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 |
From: Matt S. <Mat...@wh...> - 2007-02-20 22:25:35
|
Cool idea! Where are you headed with this? One thing I worry about is that we may be introducing circular dependencies. Languages depend on converters which in turn depend on reflectors. If we make a reflector that is dependent on a language I wonder if that could get us into trouble. Matt S Matt Benson wrote: > I've just implemented a reflector over SimpleLanguage, > which is of course itself implemented over the basic > reflectors. Trust me, this is going somewhere... > > Incidentally, the tests for > SimpleLanguageBeanReflector implement the long-overdue > testing of SimpleLanguage.set(). :) > > more later, > Matt (B) > > > > > ____________________________________________________________________________________ > Need Mail bonding? > Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. > http://answers.yahoo.com/dir/?link=list&sid=396546091 > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > > |
From: Matt B. <gud...@ya...> - 2007-02-20 23:09:44
|
--- Matt Sgarlata <Mat...@wh...> wrote: > Cool idea! Where are you headed with this? If I tell you, I'm deprived of my curtain-pulling ta-da moment... But since you're asking, I'll tell you: Dozer is the other OSS object-conversion framework that anyone knows about that has enough meat to be viable for real work. A lot of people probably wouldn't switch from Dozer to Morph if they perceived themselves as losing anything in the way of functionality. Dozer's primary configuration interface is an XML resource. Morph on the other hand must be configured entirely programmatically or Spring-wired. What I have been working on these past couple of weeks is a means of mapping properties using a configuration format specific to Morph. Wow, you say sarcastically... But there's more! :) I can already build simple configuration-file driven copiers composed of PropertyNameMapping/MatchingCopiers, so my next step was, in true me-too fashion, to be able to map complex properties (Dozer does this). I -believe- the only thing I needed here was to implement a reflector capable of interpreting complex properties (done), and set that as the reflector on my generated PropertyNameMappingCopiers, but I haven't done this yet. Is that all? Of course not! What's cool about simply duplicating someone else's functionality? Only if you can one-up them in some way do you come out ahead. >:) Example: ever since I began working with Dozer, they provided a unidirectional mapping feature. However, the one direction was only from "class A" to "class B"--a limitation (the Dozer team recognizes it as such). This was tedious to define in their XML format so they still, as far as I know, haven't done it. XML is clunky anyway. So what I am working on is a custom (ANTLR-implemented) DSL for Morph property mapping. Example 1: basic mapping net.sf.morph.transform.copiers.dsl.test.A : net.sf.morph.transform.copiers.dsl.test.B { *, stringA : stringB, intA : intB, objectA : objectB } The above signifies a bidirectional mapping association between two classes. The asterisk signifies that matching property names will be copied, and that the three paired mappings will be made. Example 2: mapping some fields leftward only (Dozer can only do rightward) net.sf.morph.transform.copiers.dsl.test.A : net.sf.morph.transform.copiers.dsl.test.B { *, stringA<=stringB, intA<=intB, objectA<=objectB } As above, the matching properties will be mapped. The explicitly defined properties only go from class B to class A. To specify all mapping to be leftward only, the class association can be defined with <= . As you would expect, => indicates rightward mappings. There are other little things but that's the jist of it, anyway. I'm hoping this will ease the transition of hypothetical users from Dozer to Morph. ;) > > One thing I worry about is that we may be > introducing circular > dependencies. Languages depend on converters which > in turn depend on > reflectors. If we make a reflector that is > dependent on a language I > wonder if that could get us into trouble. I hear you, but composition is such an integral part of Morph's architecture that I just don't see a lot of danger here. As you can see, my intent is to make it even deeper! I want to make a delegatingCopier that depends on propertyCopiers that depend on reflectors that depend on languages that depend on reflectors... I think that's right. :) Ultimately I think that yes, if you misconfigure Morph it will fail spectacularly. That seems to me more likely than for it to misbehave subtly. Anyway, I am doing my DSLDefinedCopier in the sandbox, so hopefully I'll have something to check in later this week for your perusal. Incidentally, if you have a better name than DSLDefinedCopier, I'm all ears. :) -Matt B > > Matt S > > Matt Benson wrote: > > I've just implemented a reflector over > SimpleLanguage, > > which is of course itself implemented over the > basic > > reflectors. Trust me, this is going somewhere... > > > > Incidentally, the tests for > > SimpleLanguageBeanReflector implement the > long-overdue > > testing of SimpleLanguage.set(). :) > > > > more later, > > Matt (B) > > > > > > > > > > > ____________________________________________________________________________________ > > Need Mail bonding? > > Go to the Yahoo! Mail Q&A for great tips from > Yahoo! Answers users. > > > http://answers.yahoo.com/dir/?link=list&sid=396546091 > > > > > ------------------------------------------------------------------------- > > 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=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > morph-developer mailing list > > mor...@li... > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > ____________________________________________________________________________________ Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html |
From: Matt S. <Mat...@wh...> - 2007-02-20 23:26:40
|
Wow, that looks fantastic! Morph has the ability to do very complex mappings between different types of objects, but it is a pain in the neck to set up. This looks like it would be very friendly towards people new to Morph and to former Dozer users in particular. I've also thought that perhaps it would be possible to setup some type of Morph XML Schema that would plug seamlessly into Spring, but as you mentioned, XML is rather clunky. Matt S Matt Benson wrote: > --- Matt Sgarlata > <Mat...@wh...> wrote: > > >> Cool idea! Where are you headed with this? >> > > If I tell you, I'm deprived of my curtain-pulling > ta-da moment... But since you're asking, I'll tell > you: > > Dozer is the other OSS object-conversion framework > that anyone knows about that has enough meat to be > viable for real work. A lot of people probably > wouldn't switch from Dozer to Morph if they perceived > themselves as losing anything in the way of > functionality. Dozer's primary configuration > interface is an XML resource. Morph on the other hand > must be configured entirely programmatically or > Spring-wired. What I have been working on these past > couple of weeks is a means of mapping properties using > a configuration format specific to Morph. Wow, you > say sarcastically... But there's more! :) I can > already build simple configuration-file driven copiers > composed of PropertyNameMapping/MatchingCopiers, so my > next step was, in true me-too fashion, to be able to > map complex properties (Dozer does this). I -believe- > the only thing I needed here was to implement a > reflector capable of interpreting complex properties > (done), and set that as the reflector on my generated > PropertyNameMappingCopiers, but I haven't done this > yet. > > Is that all? Of course not! What's cool about simply > duplicating someone else's functionality? Only if you > can one-up them in some way do you come out ahead. > >> :) Example: ever since I began working with Dozer, >> > they provided a unidirectional mapping feature. > However, the one direction was only from "class A" to > "class B"--a limitation (the Dozer team recognizes it > as such). This was tedious to define in their XML > format so they still, as far as I know, haven't done > it. XML is clunky anyway. So what I am working on is > a custom (ANTLR-implemented) DSL for Morph property > mapping. > > Example 1: basic mapping > > net.sf.morph.transform.copiers.dsl.test.A : > net.sf.morph.transform.copiers.dsl.test.B { > *, > stringA : stringB, > intA : intB, > objectA : objectB > } > > The above signifies a bidirectional mapping > association between two classes. The asterisk > signifies that matching property names will be copied, > and that the three paired mappings will be made. > > Example 2: mapping some fields leftward only (Dozer > can only do rightward) > > net.sf.morph.transform.copiers.dsl.test.A : > net.sf.morph.transform.copiers.dsl.test.B { > *, > stringA<=stringB, > intA<=intB, > objectA<=objectB > } > > As above, the matching properties will be mapped. The > explicitly defined properties only go from class B to > class A. To specify all mapping to be leftward only, > the class association can be defined with <= . As you > would expect, => indicates rightward mappings. > > There are other little things but that's the jist of > it, anyway. I'm hoping this will ease the transition > of hypothetical users from Dozer to Morph. ;) > > >> One thing I worry about is that we may be >> introducing circular >> dependencies. Languages depend on converters which >> in turn depend on >> reflectors. If we make a reflector that is >> dependent on a language I >> wonder if that could get us into trouble. >> > > I hear you, but composition is such an integral part > of Morph's architecture that I just don't see a lot of > danger here. As you can see, my intent is to make it > even deeper! I want to make a delegatingCopier that > depends on propertyCopiers that depend on reflectors > that depend on languages that depend on reflectors... > I think that's right. :) Ultimately I think that > yes, if you misconfigure Morph it will fail > spectacularly. That seems to me more likely than for > it to misbehave subtly. Anyway, I am doing my > DSLDefinedCopier in the sandbox, so hopefully I'll > have something to check in later this week for your > perusal. Incidentally, if you have a better name than > DSLDefinedCopier, I'm all ears. :) > > -Matt B > >> Matt S >> >> Matt Benson wrote: >> >>> I've just implemented a reflector over >>> >> SimpleLanguage, >> >>> which is of course itself implemented over the >>> >> basic >> >>> reflectors. Trust me, this is going somewhere... >>> >>> Incidentally, the tests for >>> SimpleLanguageBeanReflector implement the >>> >> long-overdue >> >>> testing of SimpleLanguage.set(). :) >>> >>> more later, >>> Matt (B) >>> >>> >>> >>> >>> >>> > ____________________________________________________________________________________ > >>> Need Mail bonding? >>> Go to the Yahoo! Mail Q&A for great tips from >>> >> Yahoo! Answers users. >> > http://answers.yahoo.com/dir/?link=list&sid=396546091 > >>> > ------------------------------------------------------------------------- > >>> 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=join.php&p=sourceforge&CID=DEVDEV > >>> _______________________________________________ >>> morph-developer mailing list >>> mor...@li... >>> >>> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >>> >>> >> >> > ------------------------------------------------------------------------- > >> 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=join.php&p=sourceforge&CID=DEVDEV > >> _______________________________________________ >> morph-developer mailing list >> mor...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > > ___________________/_________________________________________________________________ > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > > |
From: Matt B. <gud...@ya...> - 2007-02-20 23:31:48
|
--- Matt Sgarlata <Mat...@wh...> wrote: > Wow, that looks fantastic! Morph has the ability to > do very complex > mappings between different types of objects, but it > is a pain in the > neck to set up. This looks like it would be very > friendly towards > people new to Morph and to former Dozer users in > particular. > I'm glad you like it. :) > I've also thought that perhaps it would be possible > to setup some type > of Morph XML Schema that would plug seamlessly into > Spring, but as you > mentioned, XML is rather clunky. > One thing that might work here is to implement a Spring 2.0 XML schema, but just use nested text (of the format I outlined) in a <morph:something> element. :) Have your cake and eat it too. -Matt B > Matt S [SNIP] ____________________________________________________________________________________ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. |
From: Matt S. <Mat...@wh...> - 2007-02-22 19:15:46
|
> One thing that might work here is to implement a > Spring 2.0 XML schema, but just use nested text (of > the format I outlined) in a <morph:something> element. > :) Have your cake and eat it too. > Excellent idea. I've been thinking more about the SimpleLanguageBeanReflector and I am still concerned that we could be introducing something dangerous into the API. Is there a reason you can't use the Language API directly to implement what you are working on? This would also free you from the depending on a concrete implementation of the Language interface... Matt |
From: Matt B. <gud...@ya...> - 2007-02-23 20:38:19
|
--- Matt Sgarlata <Mat...@wh...> wrote: > > > One thing that might work here is to implement a > > Spring 2.0 XML schema, but just use nested text > (of > > the format I outlined) in a <morph:something> > element. > > :) Have your cake and eat it too. > > > Excellent idea. > > I've been thinking more about the > SimpleLanguageBeanReflector and I am > still concerned that we could be introducing > something dangerous into > the API. Is there a reason you can't use the > Language API directly to > implement what you are working on? > > This would also free you from the depending on a > concrete implementation > of the Language interface... "What I am working on" = basically a deep PropertyNameMappingCopier . IMO, Languages depend mostly on Reflectors rather than Transformers so a Transformer that uses a Language rather than a Reflector is possibly a positive thing. And as for depending explicitly on SimpleLanguage, I am defenseless on that front. My approach here was to reduce code duplication--"a deep property mapping copier is similar to a shallow one"--but I will weigh my options here and inform. -Matt B > > Matt > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > ____________________________________________________________________________________ We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 |
From: Alan S. <ala...@op...> - 2007-02-21 06:25:16
|
Hi I'm a user of Dozer and wanted to know if the changes Ben Alex suggested will be incorporated into Morph and if so, when? Regards Alan Matt Benson wrote: > --- Matt Sgarlata > <Mat...@wh...> wrote: > > >> Cool idea! Where are you headed with this? >> > > If I tell you, I'm deprived of my curtain-pulling > ta-da moment... But since you're asking, I'll tell > you: > > Dozer is the other OSS object-conversion framework > that anyone knows about that has enough meat to be > viable for real work. A lot of people probably > wouldn't switch from Dozer to Morph if they perceived > themselves as losing anything in the way of > functionality. Dozer's primary configuration > interface is an XML resource. Morph on the other hand > must be configured entirely programmatically or > Spring-wired. What I have been working on these past > couple of weeks is a means of mapping properties using > a configuration format specific to Morph. Wow, you > say sarcastically... But there's more! :) I can > already build simple configuration-file driven copiers > composed of PropertyNameMapping/MatchingCopiers, so my > next step was, in true me-too fashion, to be able to > map complex properties (Dozer does this). I -believe- > the only thing I needed here was to implement a > reflector capable of interpreting complex properties > (done), and set that as the reflector on my generated > PropertyNameMappingCopiers, but I haven't done this > yet. > > Is that all? Of course not! What's cool about simply > duplicating someone else's functionality? Only if you > can one-up them in some way do you come out ahead. > >> :) Example: ever since I began working with Dozer, >> > they provided a unidirectional mapping feature. > However, the one direction was only from "class A" to > "class B"--a limitation (the Dozer team recognizes it > as such). This was tedious to define in their XML > format so they still, as far as I know, haven't done > it. XML is clunky anyway. So what I am working on is > a custom (ANTLR-implemented) DSL for Morph property > mapping. > > Example 1: basic mapping > > net.sf.morph.transform.copiers.dsl.test.A : > net.sf.morph.transform.copiers.dsl.test.B { > *, > stringA : stringB, > intA : intB, > objectA : objectB > } > > The above signifies a bidirectional mapping > association between two classes. The asterisk > signifies that matching property names will be copied, > and that the three paired mappings will be made. > > Example 2: mapping some fields leftward only (Dozer > can only do rightward) > > net.sf.morph.transform.copiers.dsl.test.A : > net.sf.morph.transform.copiers.dsl.test.B { > *, > stringA<=stringB, > intA<=intB, > objectA<=objectB > } > > As above, the matching properties will be mapped. The > explicitly defined properties only go from class B to > class A. To specify all mapping to be leftward only, > the class association can be defined with <= . As you > would expect, => indicates rightward mappings. > > There are other little things but that's the jist of > it, anyway. I'm hoping this will ease the transition > of hypothetical users from Dozer to Morph. ;) > > >> One thing I worry about is that we may be >> introducing circular >> dependencies. Languages depend on converters which >> in turn depend on >> reflectors. If we make a reflector that is >> dependent on a language I >> wonder if that could get us into trouble. >> > > I hear you, but composition is such an integral part > of Morph's architecture that I just don't see a lot of > danger here. As you can see, my intent is to make it > even deeper! I want to make a delegatingCopier that > depends on propertyCopiers that depend on reflectors > that depend on languages that depend on reflectors... > I think that's right. :) Ultimately I think that > yes, if you misconfigure Morph it will fail > spectacularly. That seems to me more likely than for > it to misbehave subtly. Anyway, I am doing my > DSLDefinedCopier in the sandbox, so hopefully I'll > have something to check in later this week for your > perusal. Incidentally, if you have a better name than > DSLDefinedCopier, I'm all ears. :) > > -Matt B > >> Matt S >> >> Matt Benson wrote: >> >>> I've just implemented a reflector over >>> >> SimpleLanguage, >> >>> which is of course itself implemented over the >>> >> basic >> >>> reflectors. Trust me, this is going somewhere... >>> >>> Incidentally, the tests for >>> SimpleLanguageBeanReflector implement the >>> >> long-overdue >> >>> testing of SimpleLanguage.set(). :) >>> >>> more later, >>> Matt (B) >>> >>> >>> >>> >>> >>> > ____________________________________________________________________________________ > >>> Need Mail bonding? >>> Go to the Yahoo! Mail Q&A for great tips from >>> >> Yahoo! Answers users. >> > http://answers.yahoo.com/dir/?link=list&sid=396546091 > >>> > ------------------------------------------------------------------------- > >>> 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=join.php&p=sourceforge&CID=DEVDEV > >>> _______________________________________________ >>> morph-developer mailing list >>> mor...@li... >>> >>> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >>> >>> >> >> > ------------------------------------------------------------------------- > >> 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=join.php&p=sourceforge&CID=DEVDEV > >> _______________________________________________ >> morph-developer mailing list >> mor...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > > ____________________________________________________________________________________ > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > > |
From: Matt S. <Mat...@wh...> - 2007-02-21 14:59:14
|
Hi Alan - the patches will either be accepted or modified and then accepted. I promise we will do this before the next Morph release. So when is the next Morph release? Well, as you can tell, they aren't very frequent. The main reason is that I do software development as a full time job, so Morph isn't really a hobby in quite the same way as it used to be. If Matt B starts to push for a release, I will chip in and make sure the patches are either accepted or accepted and modified before the release. Matt S Alan Stewart wrote: > Hi > I'm a user of Dozer and wanted to know if the changes Ben Alex suggested > will be incorporated into Morph and if so, when? > Regards > Alan > > Matt Benson wrote: > >> --- Matt Sgarlata >> <Mat...@wh...> wrote: >> >> >> >>> Cool idea! Where are you headed with this? >>> >>> >> If I tell you, I'm deprived of my curtain-pulling >> ta-da moment... But since you're asking, I'll tell >> you: >> >> Dozer is the other OSS object-conversion framework >> that anyone knows about that has enough meat to be >> viable for real work. A lot of people probably >> wouldn't switch from Dozer to Morph if they perceived >> themselves as losing anything in the way of >> functionality. Dozer's primary configuration >> interface is an XML resource. Morph on the other hand >> must be configured entirely programmatically or >> Spring-wired. What I have been working on these past >> couple of weeks is a means of mapping properties using >> a configuration format specific to Morph. Wow, you >> say sarcastically... But there's more! :) I can >> already build simple configuration-file driven copiers >> composed of PropertyNameMapping/MatchingCopiers, so my >> next step was, in true me-too fashion, to be able to >> map complex properties (Dozer does this). I -believe- >> the only thing I needed here was to implement a >> reflector capable of interpreting complex properties >> (done), and set that as the reflector on my generated >> PropertyNameMappingCopiers, but I haven't done this >> yet. >> >> Is that all? Of course not! What's cool about simply >> duplicating someone else's functionality? Only if you >> can one-up them in some way do you come out ahead. >> >> >>> :) Example: ever since I began working with Dozer, >>> >>> >> they provided a unidirectional mapping feature. >> However, the one direction was only from "class A" to >> "class B"--a limitation (the Dozer team recognizes it >> as such). This was tedious to define in their XML >> format so they still, as far as I know, haven't done >> it. XML is clunky anyway. So what I am working on is >> a custom (ANTLR-implemented) DSL for Morph property >> mapping. >> >> Example 1: basic mapping >> >> net.sf.morph.transform.copiers.dsl.test.A : >> net.sf.morph.transform.copiers.dsl.test.B { >> *, >> stringA : stringB, >> intA : intB, >> objectA : objectB >> } >> >> The above signifies a bidirectional mapping >> association between two classes. The asterisk >> signifies that matching property names will be copied, >> and that the three paired mappings will be made. >> >> Example 2: mapping some fields leftward only (Dozer >> can only do rightward) >> >> net.sf.morph.transform.copiers.dsl.test.A : >> net.sf.morph.transform.copiers.dsl.test.B { >> *, >> stringA<=stringB, >> intA<=intB, >> objectA<=objectB >> } >> >> As above, the matching properties will be mapped. The >> explicitly defined properties only go from class B to >> class A. To specify all mapping to be leftward only, >> the class association can be defined with <= . As you >> would expect, => indicates rightward mappings. >> >> There are other little things but that's the jist of >> it, anyway. I'm hoping this will ease the transition >> of hypothetical users from Dozer to Morph. ;) >> >> >> >>> One thing I worry about is that we may be >>> introducing circular >>> dependencies. Languages depend on converters which >>> in turn depend on >>> reflectors. If we make a reflector that is >>> dependent on a language I >>> wonder if that could get us into trouble. >>> >>> >> I hear you, but composition is such an integral part >> of Morph's architecture that I just don't see a lot of >> danger here. As you can see, my intent is to make it >> even deeper! I want to make a delegatingCopier that >> depends on propertyCopiers that depend on reflectors >> that depend on languages that depend on reflectors... >> I think that's right. :) Ultimately I think that >> yes, if you misconfigure Morph it will fail >> spectacularly. That seems to me more likely than for >> it to misbehave subtly. Anyway, I am doing my >> DSLDefinedCopier in the sandbox, so hopefully I'll >> have something to check in later this week for your >> perusal. Incidentally, if you have a better name than >> DSLDefinedCopier, I'm all ears. :) >> >> -Matt B >> >> >>> Matt S >>> >>> Matt Benson wrote: >>> >>> >>>> I've just implemented a reflector over >>>> >>>> >>> SimpleLanguage, >>> >>> >>>> which is of course itself implemented over the >>>> >>>> >>> basic >>> >>> >>>> reflectors. Trust me, this is going somewhere... >>>> >>>> Incidentally, the tests for >>>> SimpleLanguageBeanReflector implement the >>>> >>>> >>> long-overdue >>> >>> >>>> testing of SimpleLanguage.set(). :) >>>> >>>> more later, >>>> Matt (B) >>>> >>>> >>>> >>>> >>>> >>>> >>>> >> ____________________________________________________________________________________ >> >> >>>> Need Mail bonding? >>>> Go to the Yahoo! Mail Q&A for great tips from >>>> >>>> >>> Yahoo! Answers users. >>> >>> >> http://answers.yahoo.com/dir/?link=list&sid=396546091 >> >> >>>> >>>> >> ------------------------------------------------------------------------- >> >> >>>> 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=join.php&p=sourceforge&CID=DEVDEV >> >> >>>> _______________________________________________ >>>> morph-developer mailing list >>>> mor...@li... >>>> >>>> >>>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >> >>>> >>>> >>>> >>> >>> >> ------------------------------------------------------------------------- >> >> >>> 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=join.php&p=sourceforge&CID=DEVDEV >> >> >>> _______________________________________________ >>> morph-developer mailing list >>> mor...@li... >>> >>> >>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >> >> >> >> >> ____________________________________________________________________________________ >> Expecting? Get great news right away with email Auto-Check. >> Try the Yahoo! Mail Beta. >> http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html >> >> ------------------------------------------------------------------------- >> 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=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> morph-developer mailing list >> mor...@li... >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >> >> > > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > > |
From: Matt B. <gud...@ya...> - 2007-02-22 13:21:28
|
Did I/we lose track of something? I can't recall that there are any outstanding patches from Ben that haven't been applied to HEAD. And yes, we should probably do a release sometime in the near future IMHO... :| -Matt --- Matt Sgarlata <Mat...@wh...> wrote: > Hi Alan - the patches will either be accepted or > modified and then > accepted. I promise we will do this before the next > Morph release. > > So when is the next Morph release? Well, as you can > tell, they aren't > very frequent. The main reason is that I do > software development as a > full time job, so Morph isn't really a hobby in > quite the same way as it > used to be. If Matt B starts to push for a release, > I will chip in and > make sure the patches are either accepted or > accepted and modified > before the release. > > Matt S > > Alan Stewart wrote: > > Hi > > I'm a user of Dozer and wanted to know if the > changes Ben Alex suggested > > will be incorporated into Morph and if so, when? > > Regards > > Alan > > > > Matt Benson wrote: > > > >> --- Matt Sgarlata > >> <Mat...@wh...> wrote: > >> > >> > >> > >>> Cool idea! Where are you headed with this? > >>> > >>> > >> If I tell you, I'm deprived of my curtain-pulling > >> ta-da moment... But since you're asking, I'll > tell > >> you: > >> > >> Dozer is the other OSS object-conversion > framework > >> that anyone knows about that has enough meat to > be > >> viable for real work. A lot of people probably > >> wouldn't switch from Dozer to Morph if they > perceived > >> themselves as losing anything in the way of > >> functionality. Dozer's primary configuration > >> interface is an XML resource. Morph on the other > hand > >> must be configured entirely programmatically or > >> Spring-wired. What I have been working on these > past > >> couple of weeks is a means of mapping properties > using > >> a configuration format specific to Morph. Wow, > you > >> say sarcastically... But there's more! :) I > can > >> already build simple configuration-file driven > copiers > >> composed of PropertyNameMapping/MatchingCopiers, > so my > >> next step was, in true me-too fashion, to be able > to > >> map complex properties (Dozer does this). I > -believe- > >> the only thing I needed here was to implement a > >> reflector capable of interpreting complex > properties > >> (done), and set that as the reflector on my > generated > >> PropertyNameMappingCopiers, but I haven't done > this > >> yet. > >> > >> Is that all? Of course not! What's cool about > simply > >> duplicating someone else's functionality? Only > if you > >> can one-up them in some way do you come out > ahead. > >> > >> > >>> :) Example: ever since I began working with > Dozer, > >>> > >>> > >> they provided a unidirectional mapping feature. > >> However, the one direction was only from "class > A" to > >> "class B"--a limitation (the Dozer team > recognizes it > >> as such). This was tedious to define in their > XML > >> format so they still, as far as I know, haven't > done > >> it. XML is clunky anyway. So what I am working > on is > >> a custom (ANTLR-implemented) DSL for Morph > property > >> mapping. > >> > >> Example 1: basic mapping > >> > >> net.sf.morph.transform.copiers.dsl.test.A : > >> net.sf.morph.transform.copiers.dsl.test.B { > >> *, > >> stringA : stringB, > >> intA : intB, > >> objectA : objectB > >> } > >> > >> The above signifies a bidirectional mapping > >> association between two classes. The asterisk > >> signifies that matching property names will be > copied, > >> and that the three paired mappings will be made. > >> > >> Example 2: mapping some fields leftward only > (Dozer > >> can only do rightward) > >> > >> net.sf.morph.transform.copiers.dsl.test.A : > >> net.sf.morph.transform.copiers.dsl.test.B { > >> *, > >> stringA<=stringB, > >> intA<=intB, > >> objectA<=objectB > >> } > >> > >> As above, the matching properties will be mapped. > The > >> explicitly defined properties only go from class > B to > >> class A. To specify all mapping to be leftward > only, > >> the class association can be defined with <= . > As you > >> would expect, => indicates rightward mappings. > >> > >> There are other little things but that's the jist > of > >> it, anyway. I'm hoping this will ease the > transition > >> of hypothetical users from Dozer to Morph. ;) > >> > >> > >> > >>> One thing I worry about is that we may be > >>> introducing circular > >>> dependencies. Languages depend on converters > which > >>> in turn depend on > >>> reflectors. If we make a reflector that is > >>> dependent on a language I > >>> wonder if that could get us into trouble. > >>> > >>> > >> I hear you, but composition is such an integral > part > >> of Morph's architecture that I just don't see a > lot of > >> danger here. As you can see, my intent is to > make it > >> even deeper! I want to make a delegatingCopier > that > >> depends on propertyCopiers that depend on > reflectors > >> that depend on languages that depend on > reflectors... > >> I think that's right. :) Ultimately I think > that > >> yes, if you misconfigure Morph it will fail > >> spectacularly. That seems to me more likely than > for > >> it to misbehave subtly. Anyway, I am doing my > >> DSLDefinedCopier in the sandbox, so hopefully > I'll > >> have something to check in later this week for > your > >> perusal. Incidentally, if you have a better name > than > >> DSLDefinedCopier, I'm all ears. :) > >> > >> -Matt B > >> > >> > >>> Matt S > >>> > >>> Matt Benson wrote: > >>> > >>> > >>>> I've just implemented a reflector over > >>>> > >>>> > >>> SimpleLanguage, > >>> > >>> > >>>> which is of course itself implemented over the > >>>> > >>>> > >>> basic > >>> > >>> > >>>> reflectors. Trust me, this is going > somewhere... > >>>> > >>>> Incidentally, the tests for > >>>> SimpleLanguageBeanReflector implement the > >>>> > >>>> > >>> long-overdue > >>> > >>> > >>>> testing of SimpleLanguage.set(). :) > >>>> > >>>> more later, > >>>> Matt (B) > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >> > ____________________________________________________________________________________ > >> > >> > >>>> Need Mail bonding? > >>>> Go to the Yahoo! Mail Q&A for great tips from > >>>> > >>>> > >>> Yahoo! Answers users. > >>> > >>> > >> > http://answers.yahoo.com/dir/?link=list&sid=396546091 > >> > >> > >>>> > >>>> > >> > ------------------------------------------------------------------------- > >> > >> > >>>> 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=join.php&p=sourceforge&CID=DEVDEV > >> > >> > >>>> _______________________________________________ > >>>> morph-developer mailing list > >>>> mor...@li... > >>>> > >>>> > >>>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >> > >>>> > >>>> > >>>> > >>> > >>> > >> > ------------------------------------------------------------------------- > >> > >> > >>> 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=join.php&p=sourceforge&CID=DEVDEV > >> > >> > >>> _______________________________________________ > >>> morph-developer mailing list > >>> mor...@li... > >>> > >>> > >>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >> > >> > >> > >> > >> > ____________________________________________________________________________________ > >> Expecting? Get great news right away with email > Auto-Check. > >> Try the Yahoo! Mail Beta. > >> > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > > >> > >> > ------------------------------------------------------------------------- > >> 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=join.php&p=sourceforge&CID=DEVDEV > >> _______________________________________________ > >> morph-developer mailing list > >> mor...@li... > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >> > >> > > > > > > > ------------------------------------------------------------------------- > > 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=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > morph-developer mailing list > > mor...@li... > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV> _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > ____________________________________________________________________________________ Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. http://farechase.yahoo.com/promo-generic-14795097 |
From: Matt B. <gud...@ya...> - 2007-02-22 13:30:44
|
Gotcha--forgot about the RuntimeException wrapping issue. Matt, since you've given your blessing here I can make time to stuff this in, with the behavior flag you had declared it was your intent to use. I'd like for Morph to become the indisputably "right" way to do Java object conversions. ;) -Matt --- Matt Benson <gud...@ya...> wrote: > Did I/we lose track of something? I can't recall > that > there are any outstanding patches from Ben that > haven't been applied to HEAD. And yes, we should > probably do a release sometime in the near future > IMHO... :| > > -Matt > > --- Matt Sgarlata > <Mat...@wh...> wrote: > > > Hi Alan - the patches will either be accepted or > > modified and then > > accepted. I promise we will do this before the > next > > Morph release. > > > > So when is the next Morph release? Well, as you > can > > tell, they aren't > > very frequent. The main reason is that I do > > software development as a > > full time job, so Morph isn't really a hobby in > > quite the same way as it > > used to be. If Matt B starts to push for a > release, > > I will chip in and > > make sure the patches are either accepted or > > accepted and modified > > before the release. > > > > Matt S > > > > Alan Stewart wrote: > > > Hi > > > I'm a user of Dozer and wanted to know if the > > changes Ben Alex suggested > > > will be incorporated into Morph and if so, when? > > > Regards > > > Alan > > > > > > Matt Benson wrote: > > > > > >> --- Matt Sgarlata > > >> <Mat...@wh...> > wrote: > > >> > > >> > > >> > > >>> Cool idea! Where are you headed with this? > > >>> > > >>> > > >> If I tell you, I'm deprived of my > curtain-pulling > > >> ta-da moment... But since you're asking, I'll > > tell > > >> you: > > >> > > >> Dozer is the other OSS object-conversion > > framework > > >> that anyone knows about that has enough meat to > > be > > >> viable for real work. A lot of people probably > > >> wouldn't switch from Dozer to Morph if they > > perceived > > >> themselves as losing anything in the way of > > >> functionality. Dozer's primary configuration > > >> interface is an XML resource. Morph on the > other > > hand > > >> must be configured entirely programmatically or > > >> Spring-wired. What I have been working on > these > > past > > >> couple of weeks is a means of mapping > properties > > using > > >> a configuration format specific to Morph. Wow, > > you > > >> say sarcastically... But there's more! :) I > > can > > >> already build simple configuration-file driven > > copiers > > >> composed of > PropertyNameMapping/MatchingCopiers, > > so my > > >> next step was, in true me-too fashion, to be > able > > to > > >> map complex properties (Dozer does this). I > > -believe- > > >> the only thing I needed here was to implement a > > >> reflector capable of interpreting complex > > properties > > >> (done), and set that as the reflector on my > > generated > > >> PropertyNameMappingCopiers, but I haven't done > > this > > >> yet. > > >> > > >> Is that all? Of course not! What's cool about > > simply > > >> duplicating someone else's functionality? Only > > if you > > >> can one-up them in some way do you come out > > ahead. > > >> > > >> > > >>> :) Example: ever since I began working with > > Dozer, > > >>> > > >>> > > >> they provided a unidirectional mapping feature. > > > >> However, the one direction was only from "class > > A" to > > >> "class B"--a limitation (the Dozer team > > recognizes it > > >> as such). This was tedious to define in their > > XML > > >> format so they still, as far as I know, haven't > > done > > >> it. XML is clunky anyway. So what I am > working > > on is > > >> a custom (ANTLR-implemented) DSL for Morph > > property > > >> mapping. > > >> > > >> Example 1: basic mapping > > >> > > >> net.sf.morph.transform.copiers.dsl.test.A : > > >> net.sf.morph.transform.copiers.dsl.test.B { > > >> *, > > >> stringA : stringB, > > >> intA : intB, > > >> objectA : objectB > > >> } > > >> > > >> The above signifies a bidirectional mapping > > >> association between two classes. The asterisk > > >> signifies that matching property names will be > > copied, > > >> and that the three paired mappings will be > made. > > >> > > >> Example 2: mapping some fields leftward only > > (Dozer > > >> can only do rightward) > > >> > > >> net.sf.morph.transform.copiers.dsl.test.A : > > >> net.sf.morph.transform.copiers.dsl.test.B { > > >> *, > > >> stringA<=stringB, > > >> intA<=intB, > > >> objectA<=objectB > > >> } > > >> > > >> As above, the matching properties will be > mapped. > > The > > >> explicitly defined properties only go from > class > > B to > > >> class A. To specify all mapping to be leftward > > only, > > >> the class association can be defined with <= . > > As you > > >> would expect, => indicates rightward mappings. > > >> > > >> There are other little things but that's the > jist > > of > > >> it, anyway. I'm hoping this will ease the > > transition > > >> of hypothetical users from Dozer to Morph. ;) > > >> > > >> > > >> > > >>> One thing I worry about is that we may be > > >>> introducing circular > > >>> dependencies. Languages depend on converters > > which > > >>> in turn depend on > > >>> reflectors. If we make a reflector that is > > >>> dependent on a language I > > >>> wonder if that could get us into trouble. > > >>> > > >>> > > >> I hear you, but composition is such an integral > > part > > >> of Morph's architecture that I just don't see a > > lot of > > >> danger here. As you can see, my intent is to > > make it > > >> even deeper! I want to make a delegatingCopier > > that > > >> depends on propertyCopiers that depend on > > reflectors > > >> that depend on languages that depend on > > reflectors... > > >> I think that's right. :) Ultimately I think > > that > > >> yes, if you misconfigure Morph it will fail > > >> spectacularly. That seems to me more likely > than > > for > > >> it to misbehave subtly. Anyway, I am doing my > > >> DSLDefinedCopier in the sandbox, so hopefully > > I'll > > >> have something to check in later this week for > > your > > >> perusal. Incidentally, if you have a better > name > > than > > >> DSLDefinedCopier, I'm all ears. :) > > >> > > >> -Matt B > > >> > > >> > > >>> Matt S > > >>> > > >>> Matt Benson wrote: > > >>> > > >>> > > >>>> I've just implemented a reflector over > > >>>> > > >>>> > > >>> SimpleLanguage, > > >>> > > >>> > > >>>> which is of course itself implemented over > the > > >>>> > > >>>> > > >>> basic > > >>> > > >>> > > >>>> reflectors. Trust me, this is going > > somewhere... > > >>>> > > >>>> Incidentally, the tests for > > >>>> SimpleLanguageBeanReflector implement the > > >>>> > > >>>> > > >>> long-overdue > > >>> > > >>> > > >>>> testing of SimpleLanguage.set(). :) > > >>>> > > >>>> more later, > > >>>> Matt (B) > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >> > > > ____________________________________________________________________________________ > > >> > > >> > > >>>> Need Mail bonding? > > >>>> Go to the Yahoo! Mail Q&A for great tips from > > >>>> > > >>>> > > >>> Yahoo! Answers users. > > >>> > > >>> > > >> > > > http://answers.yahoo.com/dir/?link=list&sid=396546091 > > >> > > >> > > >>>> > > >>>> > > >> > > > ------------------------------------------------------------------------- > > >> > > >> > > >>>> 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=join.php&p=sourceforge&CID=DEVDEV > > >> > > >> > > >>>> > _______________________________________________ > > >>>> morph-developer mailing list > > >>>> mor...@li... > > >>>> > > >>>> > > >>>> > > >> > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > >> > > >> > > >>>> > > >>>> > > >>>> > > >>> > > >>> > > >> > > > ------------------------------------------------------------------------- > > >> > > >> > > >>> 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=join.php&p=sourceforge&CID=DEVDEV > > >> > > >> > > >>> > _______________________________________________ > > >>> morph-developer mailing list > > >>> mor...@li... > > >>> > > >>> > > >>> > > >> > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > >> > > >> > > >> > > >> > > >> > > >> > > > ____________________________________________________________________________________ > > >> Expecting? Get great news right away with email > > Auto-Check. > > >> Try the Yahoo! Mail Beta. > > >> > > > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > > > > >> > > >> > > > ------------------------------------------------------------------------- > > >> 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=join.php&p=sourceforge&CID=DEVDEV > > >> _______________________________________________ > > >> morph-developer mailing list > > >> mor...@li... > > >> > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > >> > > >> > > >> > > > > > > > > > > > > ------------------------------------------------------------------------- > > > 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=join.php&p=sourceforge&CID=DEVDEV > > > _______________________________________________ > > > morph-developer mailing list > > > mor...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > > > > > > > > ------------------------------------------------------------------------- > > 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=join.php&p=sourceforge&CID=DEVDEV> > _______________________________________________ > > morph-developer mailing list > > mor...@li... > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > > > ____________________________________________________________________________________ > Finding fabulous fares is fun. > Let Yahoo! FareChase search your favorite travel > sites to find flight and hotel bargains. > http://farechase.yahoo.com/promo-generic-14795097 > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > ____________________________________________________________________________________ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. |
From: Matt S. <Mat...@wh...> - 2007-02-22 14:37:31
|
Awesome, thanks Matt B. I've given this a lot of thought, and whether or not to wrap exceptions should be based on whether or not the reflector or transformer delegates to some other reflector or transformer. If there is no delegation, then go ahead and wrap the exceptions because that is a Morph class. If there is delegation, there is a potential that the delegate is a user defined object rather than a Morph object, so there should not be runtime exception wrapping. Matt S Matt Benson wrote: > Gotcha--forgot about the RuntimeException wrapping > issue. Matt, since you've given your blessing here I > can make time to stuff this in, with the behavior flag > you had declared it was your intent to use. I'd like > for Morph to become the indisputably "right" way to do > Java object conversions. ;) > > -Matt > > --- Matt Benson <gud...@ya...> wrote: > > >> Did I/we lose track of something? I can't recall >> that >> there are any outstanding patches from Ben that >> haven't been applied to HEAD. And yes, we should >> probably do a release sometime in the near future >> IMHO... :| >> >> -Matt >> >> --- Matt Sgarlata >> <Mat...@wh...> wrote: >> >> >>> Hi Alan - the patches will either be accepted or >>> modified and then >>> accepted. I promise we will do this before the >>> >> next >> >>> Morph release. >>> >>> So when is the next Morph release? Well, as you >>> >> can >> >>> tell, they aren't >>> very frequent. The main reason is that I do >>> software development as a >>> full time job, so Morph isn't really a hobby in >>> quite the same way as it >>> used to be. If Matt B starts to push for a >>> >> release, >> >>> I will chip in and >>> make sure the patches are either accepted or >>> accepted and modified >>> before the release. >>> >>> Matt S >>> >>> Alan Stewart wrote: >>> >>>> Hi >>>> I'm a user of Dozer and wanted to know if the >>>> >>> changes Ben Alex suggested >>> >>>> will be incorporated into Morph and if so, when? >>>> Regards >>>> Alan >>>> >>>> Matt Benson wrote: >>>> >>>> >>>>> --- Matt Sgarlata >>>>> <Mat...@wh...> >>>>> >> wrote: >> >>>>> >>>>> >>>>> >>>>>> Cool idea! Where are you headed with this? >>>>>> >>>>>> >>>>>> >>>>> If I tell you, I'm deprived of my >>>>> >> curtain-pulling >> >>>>> ta-da moment... But since you're asking, I'll >>>>> >>> tell >>> >>>>> you: >>>>> >>>>> Dozer is the other OSS object-conversion >>>>> >>> framework >>> >>>>> that anyone knows about that has enough meat to >>>>> >>> be >>> >>>>> viable for real work. A lot of people probably >>>>> wouldn't switch from Dozer to Morph if they >>>>> >>> perceived >>> >>>>> themselves as losing anything in the way of >>>>> functionality. Dozer's primary configuration >>>>> interface is an XML resource. Morph on the >>>>> >> other >> >>> hand >>> >>>>> must be configured entirely programmatically or >>>>> Spring-wired. What I have been working on >>>>> >> these >> >>> past >>> >>>>> couple of weeks is a means of mapping >>>>> >> properties >> >>> using >>> >>>>> a configuration format specific to Morph. Wow, >>>>> >>> you >>> >>>>> say sarcastically... But there's more! :) I >>>>> >>> can >>> >>>>> already build simple configuration-file driven >>>>> >>> copiers >>> >>>>> composed of >>>>> >> PropertyNameMapping/MatchingCopiers, >> >>> so my >>> >>>>> next step was, in true me-too fashion, to be >>>>> >> able >> >>> to >>> >>>>> map complex properties (Dozer does this). I >>>>> >>> -believe- >>> >>>>> the only thing I needed here was to implement a >>>>> reflector capable of interpreting complex >>>>> >>> properties >>> >>>>> (done), and set that as the reflector on my >>>>> >>> generated >>> >>>>> PropertyNameMappingCopiers, but I haven't done >>>>> >>> this >>> >>>>> yet. >>>>> >>>>> Is that all? Of course not! What's cool about >>>>> >>> simply >>> >>>>> duplicating someone else's functionality? Only >>>>> >>> if you >>> >>>>> can one-up them in some way do you come out >>>>> >>> ahead. >>> >>>>> >>>>> >>>>> >>>>>> :) Example: ever since I began working with >>>>>> >>> Dozer, >>> >>>>>> >>>>>> >>>>>> >>>>> they provided a unidirectional mapping feature. >>>>> >>>>> However, the one direction was only from "class >>>>> >>> A" to >>> >>>>> "class B"--a limitation (the Dozer team >>>>> >>> recognizes it >>> >>>>> as such). This was tedious to define in their >>>>> >>> XML >>> >>>>> format so they still, as far as I know, haven't >>>>> >>> done >>> >>>>> it. XML is clunky anyway. So what I am >>>>> >> working >> >>> on is >>> >>>>> a custom (ANTLR-implemented) DSL for Morph >>>>> >>> property >>> >>>>> mapping. >>>>> >>>>> Example 1: basic mapping >>>>> >>>>> net.sf.morph.transform.copiers.dsl.test.A : >>>>> net.sf.morph.transform.copiers.dsl.test.B { >>>>> *, >>>>> stringA : stringB, >>>>> intA : intB, >>>>> objectA : objectB >>>>> } >>>>> >>>>> The above signifies a bidirectional mapping >>>>> association between two classes. The asterisk >>>>> signifies that matching property names will be >>>>> >>> copied, >>> >>>>> and that the three paired mappings will be >>>>> >> made. >> >>>>> Example 2: mapping some fields leftward only >>>>> >>> (Dozer >>> >>>>> can only do rightward) >>>>> >>>>> net.sf.morph.transform.copiers.dsl.test.A : >>>>> net.sf.morph.transform.copiers.dsl.test.B { >>>>> *, >>>>> stringA<=stringB, >>>>> intA<=intB, >>>>> objectA<=objectB >>>>> } >>>>> >>>>> As above, the matching properties will be >>>>> >> mapped. >> >>> The >>> >>>>> explicitly defined properties only go from >>>>> >> class >> >>> B to >>> >>>>> class A. To specify all mapping to be leftward >>>>> >>> only, >>> >>>>> the class association can be defined with <= . >>>>> >>> As you >>> >>>>> would expect, => indicates rightward mappings. >>>>> >>>>> There are other little things but that's the >>>>> >> jist >> >>> of >>> >>>>> it, anyway. I'm hoping this will ease the >>>>> >>> transition >>> >>>>> of hypothetical users from Dozer to Morph. ;) >>>>> >>>>> >>>>> >>>>> >>>>>> One thing I worry about is that we may be >>>>>> introducing circular >>>>>> dependencies. Languages depend on converters >>>>>> >>> which >>> >>>>>> in turn depend on >>>>>> reflectors. If we make a reflector that is >>>>>> dependent on a language I >>>>>> wonder if that could get us into trouble. >>>>>> >>>>>> >>>>>> >>>>> I hear you, but composition is such an integral >>>>> >>> part >>> >>>>> of Morph's architecture that I just don't see a >>>>> >>> lot of >>> >>>>> danger here. As you can see, my intent is to >>>>> >>> make it >>> >>>>> even deeper! I want to make a delegatingCopier >>>>> >>> that >>> >>>>> depends on propertyCopiers that depend on >>>>> >>> reflectors >>> >>>>> that depend on languages that depend on >>>>> >>> reflectors... >>> >>>>> I think that's right. :) Ultimately I think >>>>> >>> that >>> >>>>> yes, if you misconfigure Morph it will fail >>>>> spectacularly. That seems to me more likely >>>>> >> than >> >>> for >>> >>>>> it to misbehave subtly. Anyway, I am doing my >>>>> DSLDefinedCopier in the sandbox, so hopefully >>>>> >>> I'll >>> >>>>> have something to check in later this week for >>>>> >>> your >>> >>>>> perusal. Incidentally, if you have a better >>>>> >> name >> >>> than >>> >>>>> DSLDefinedCopier, I'm all ears. :) >>>>> >>>>> -Matt B >>>>> >>>>> >>>>> >>>>>> Matt S >>>>>> >>>>>> Matt Benson wrote: >>>>>> >>>>>> >>>>>> >>>>>>> I've just implemented a reflector over >>>>>>> >>>>>>> >>>>>>> >>>>>> SimpleLanguage, >>>>>> >>>>>> >>>>>> >>>>>>> which is of course itself implemented over >>>>>>> >> the >> >>>>>>> >>>>>>> >>>>>>> >>>>>> basic >>>>>> >>>>>> >>>>>> >>>>>>> reflectors. Trust me, this is going >>>>>>> >>> somewhere... >>> >>>>>>> Incidentally, the tests for >>>>>>> SimpleLanguageBeanReflector implement the >>>>>>> >>>>>>> >>>>>>> >>>>>> long-overdue >>>>>> >>>>>> >>>>>> >>>>>>> testing of SimpleLanguage.set(). :) >>>>>>> >>>>>>> more later, >>>>>>> Matt (B) >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> > ____________________________________________________________________________________ > >>>>> >>>>> >>>>> >>>>>>> Need Mail bonding? >>>>>>> Go to the Yahoo! Mail Q&A for great tips from >>>>>>> >>>>>>> >>>>>>> >>>>>> Yahoo! Answers users. >>>>>> >>>>>> >>>>>> > http://answers.yahoo.com/dir/?link=list&sid=396546091 > >>>>> >>>>> >>>>> >>>>>>> >>>>>>> >>>>>>> > ------------------------------------------------------------------------- > >>>>> >>>>> >>>>> >>>>>>> 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=join.php&p=sourceforge&CID=DEVDEV > >>>>> >>>>> >>>>> >> _______________________________________________ >> >>>>>>> morph-developer mailing list >>>>>>> mor...@li... >>>>>>> >>>>>>> >>>>>>> >>>>>>> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >>>>> >>>>> >>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> > ------------------------------------------------------------------------- > >>>>> >>>>> >>>>> >>>>>> 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=join.php&p=sourceforge&CID=DEVDEV > >>>>> >>>>> >>>>> >> _______________________________________________ >> >>>>>> morph-developer mailing list >>>>>> mor...@li... >>>>>> >>>>>> >>>>>> >>>>>> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> > ____________________________________________________________________________________ > >>>>> Expecting? Get great news right away with email >>>>> >>> Auto-Check. >>> >>>>> Try the Yahoo! Mail Beta. >>>>> >>>>> > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > >>>>> > ------------------------------------------------------------------------- > >>>>> 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=join.php&p=sourceforge&CID=DEVDEV > >>>>> _______________________________________________ >>>>> morph-developer mailing list >>>>> mor...@li... >>>>> >>>>> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >>>>> >>>>> >>>>> >>>> >>>> > ------------------------------------------------------------------------- > >>>> 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=join.php&p=sourceforge&CID=DEVDEV > >>>> _______________________________________________ >>>> morph-developer mailing list >>>> mor...@li... >>>> >>>> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >>>> >>>> > ------------------------------------------------------------------------- > >>> 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=join.php&p=sourceforge&CID=DEVDEV> > >> _______________________________________________ >> >>> morph-developer mailing list >>> mor...@li... >>> >>> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> >> >> >> > ____________________________________________________________________________________ > >> Finding fabulous fares is fun. >> Let Yahoo! FareChase search your favorite travel >> sites to find flight and hotel bargains. >> http://farechase.yahoo.com/promo-generic-14795097 >> >> >> > ------------------------------------------------------------------------- > >> 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=join.php&p=sourceforge&CID=DEVDEV > >> _______________________________________________ >> morph-developer mailing list >> mor...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > > ____________________________________________________________________________________ > Have a burning question? > Go to www.Answers.yahoo.com and get answers from real people who know. > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > > |
From: Matt S. <Mat...@wh...> - 2007-04-11 00:47:32
|
I think this issue died again. As I've thought about this more, I'm fine with the change. I don't think we need to introduce the flag initially unless we find that test cases start to fail because some type of exception other than TransformationException is thrown. I may go ahead and introduce this change myself in the next couple days, unless you've already started on it Matt B. I started working on this in January then had some doubt about my approach and put it aside again. Matt S Matt Sgarlata wrote: > Awesome, thanks Matt B. > > I've given this a lot of thought, and whether or not to wrap > exceptions should be based on whether or not the reflector or > transformer delegates to some other reflector or transformer. If > there is no delegation, then go ahead and wrap the exceptions because > that is a Morph class. If there is delegation, there is a potential > that the delegate is a user defined object rather than a Morph object, > so there should not be runtime exception wrapping. > > Matt S > > Matt Benson wrote: >> Gotcha--forgot about the RuntimeException wrapping >> issue. Matt, since you've given your blessing here I >> can make time to stuff this in, with the behavior flag >> you had declared it was your intent to use. I'd like >> for Morph to become the indisputably "right" way to do >> Java object conversions. ;) >> >> -Matt >> >> --- Matt Benson <gud...@ya...> wrote: >> >> >>> Did I/we lose track of something? I can't recall >>> that >>> there are any outstanding patches from Ben that >>> haven't been applied to HEAD. And yes, we should >>> probably do a release sometime in the near future >>> IMHO... :| >>> >>> -Matt >>> >>> --- Matt Sgarlata >>> <Mat...@wh...> wrote: >>> >>> >>>> Hi Alan - the patches will either be accepted or >>>> modified and then >>>> accepted. I promise we will do this before the >>>> >>> next >>> >>>> Morph release. >>>> >>>> So when is the next Morph release? Well, as you >>>> >>> can >>> >>>> tell, they aren't >>>> very frequent. The main reason is that I do >>>> software development as a >>>> full time job, so Morph isn't really a hobby in >>>> quite the same way as it >>>> used to be. If Matt B starts to push for a >>>> >>> release, >>> >>>> I will chip in and >>>> make sure the patches are either accepted or >>>> accepted and modified >>>> before the release. >>>> >>>> Matt S >>>> >>>> Alan Stewart wrote: >>>> >>>>> Hi >>>>> I'm a user of Dozer and wanted to know if the >>>>> >>>> changes Ben Alex suggested >>>> >>>>> will be incorporated into Morph and if so, when? >>>>> Regards >>>>> Alan >>>>> >>>>> Matt Benson wrote: >>>>> >>>>> >>>>>> --- Matt Sgarlata >>>>>> <Mat...@wh...> >>>>>> >>> wrote: >>> >>>>>> >>>>>> >>>>>> >>>>>>> Cool idea! Where are you headed with this? >>>>>>> >>>>>>> >>>>>>> >>>>>> If I tell you, I'm deprived of my >>>>>> >>> curtain-pulling >>> >>>>>> ta-da moment... But since you're asking, I'll >>>>>> >>>> tell >>>> >>>>>> you: >>>>>> >>>>>> Dozer is the other OSS object-conversion >>>>>> >>>> framework >>>> >>>>>> that anyone knows about that has enough meat to >>>>>> >>>> be >>>> >>>>>> viable for real work. A lot of people probably >>>>>> wouldn't switch from Dozer to Morph if they >>>>>> >>>> perceived >>>> >>>>>> themselves as losing anything in the way of >>>>>> functionality. Dozer's primary configuration >>>>>> interface is an XML resource. Morph on the >>>>>> >>> other >>> >>>> hand >>>> >>>>>> must be configured entirely programmatically or >>>>>> Spring-wired. What I have been working on >>>>>> >>> these >>> >>>> past >>>> >>>>>> couple of weeks is a means of mapping >>>>>> >>> properties >>> >>>> using >>>> >>>>>> a configuration format specific to Morph. Wow, >>>>>> >>>> you >>>> >>>>>> say sarcastically... But there's more! :) I >>>>>> >>>> can >>>> >>>>>> already build simple configuration-file driven >>>>>> >>>> copiers >>>> >>>>>> composed of >>>>>> >>> PropertyNameMapping/MatchingCopiers, >>> >>>> so my >>>> >>>>>> next step was, in true me-too fashion, to be >>>>>> >>> able >>> >>>> to >>>> >>>>>> map complex properties (Dozer does this). I >>>>>> >>>> -believe- >>>> >>>>>> the only thing I needed here was to implement a >>>>>> reflector capable of interpreting complex >>>>>> >>>> properties >>>> >>>>>> (done), and set that as the reflector on my >>>>>> >>>> generated >>>> >>>>>> PropertyNameMappingCopiers, but I haven't done >>>>>> >>>> this >>>> >>>>>> yet. >>>>>> >>>>>> Is that all? Of course not! What's cool about >>>>>> >>>> simply >>>> >>>>>> duplicating someone else's functionality? Only >>>>>> >>>> if you >>>> >>>>>> can one-up them in some way do you come out >>>>>> >>>> ahead. >>>> >>>>>> >>>>>> >>>>>> >>>>>>> :) Example: ever since I began working with >>>>>>> >>>> Dozer, >>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> they provided a unidirectional mapping feature. >>>>>> >>>>>> However, the one direction was only from "class >>>>>> >>>> A" to >>>> >>>>>> "class B"--a limitation (the Dozer team >>>>>> >>>> recognizes it >>>> >>>>>> as such). This was tedious to define in their >>>>>> >>>> XML >>>> >>>>>> format so they still, as far as I know, haven't >>>>>> >>>> done >>>> >>>>>> it. XML is clunky anyway. So what I am >>>>>> >>> working >>> >>>> on is >>>> >>>>>> a custom (ANTLR-implemented) DSL for Morph >>>>>> >>>> property >>>> >>>>>> mapping. >>>>>> >>>>>> Example 1: basic mapping >>>>>> >>>>>> net.sf.morph.transform.copiers.dsl.test.A : >>>>>> net.sf.morph.transform.copiers.dsl.test.B { >>>>>> *, >>>>>> stringA : stringB, >>>>>> intA : intB, >>>>>> objectA : objectB >>>>>> } >>>>>> >>>>>> The above signifies a bidirectional mapping >>>>>> association between two classes. The asterisk >>>>>> signifies that matching property names will be >>>>>> >>>> copied, >>>> >>>>>> and that the three paired mappings will be >>>>>> >>> made. >>> >>>>>> Example 2: mapping some fields leftward only >>>>>> >>>> (Dozer >>>> >>>>>> can only do rightward) >>>>>> >>>>>> net.sf.morph.transform.copiers.dsl.test.A : >>>>>> net.sf.morph.transform.copiers.dsl.test.B { >>>>>> *, >>>>>> stringA<=stringB, >>>>>> intA<=intB, >>>>>> objectA<=objectB >>>>>> } >>>>>> >>>>>> As above, the matching properties will be >>>>>> >>> mapped. >>> >>>> The >>>> >>>>>> explicitly defined properties only go from >>>>>> >>> class >>> >>>> B to >>>> >>>>>> class A. To specify all mapping to be leftward >>>>>> >>>> only, >>>> >>>>>> the class association can be defined with <= . >>>>>> >>>> As you >>>> >>>>>> would expect, => indicates rightward mappings. >>>>>> >>>>>> There are other little things but that's the >>>>>> >>> jist >>> >>>> of >>>> >>>>>> it, anyway. I'm hoping this will ease the >>>>>> >>>> transition >>>> >>>>>> of hypothetical users from Dozer to Morph. ;) >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> One thing I worry about is that we may be >>>>>>> introducing circular >>>>>>> dependencies. Languages depend on converters >>>>>>> >>>> which >>>> >>>>>>> in turn depend on >>>>>>> reflectors. If we make a reflector that is >>>>>>> dependent on a language I >>>>>>> wonder if that could get us into trouble. >>>>>>> >>>>>>> >>>>>>> >>>>>> I hear you, but composition is such an integral >>>>>> >>>> part >>>> >>>>>> of Morph's architecture that I just don't see a >>>>>> >>>> lot of >>>> >>>>>> danger here. As you can see, my intent is to >>>>>> >>>> make it >>>> >>>>>> even deeper! I want to make a delegatingCopier >>>>>> >>>> that >>>> >>>>>> depends on propertyCopiers that depend on >>>>>> >>>> reflectors >>>> >>>>>> that depend on languages that depend on >>>>>> >>>> reflectors... >>>> >>>>>> I think that's right. :) Ultimately I think >>>>>> >>>> that >>>> >>>>>> yes, if you misconfigure Morph it will fail >>>>>> spectacularly. That seems to me more likely >>>>>> >>> than >>> >>>> for >>>> >>>>>> it to misbehave subtly. Anyway, I am doing my >>>>>> DSLDefinedCopier in the sandbox, so hopefully >>>>>> >>>> I'll >>>> >>>>>> have something to check in later this week for >>>>>> >>>> your >>>> >>>>>> perusal. Incidentally, if you have a better >>>>>> >>> name >>> >>>> than >>>> >>>>>> DSLDefinedCopier, I'm all ears. :) >>>>>> >>>>>> -Matt B >>>>>> >>>>>> >>>>>> >>>>>>> Matt S >>>>>>> >>>>>>> Matt Benson wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>>> I've just implemented a reflector over >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> SimpleLanguage, >>>>>>> >>>>>>> >>>>>>> >>>>>>>> which is of course itself implemented over >>>>>>>> >>> the >>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> basic >>>>>>> >>>>>>> >>>>>>> >>>>>>>> reflectors. Trust me, this is going >>>>>>>> >>>> somewhere... >>>> >>>>>>>> Incidentally, the tests for >>>>>>>> SimpleLanguageBeanReflector implement the >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> long-overdue >>>>>>> >>>>>>> >>>>>>> >>>>>>>> testing of SimpleLanguage.set(). :) >>>>>>>> >>>>>>>> more later, >>>>>>>> Matt (B) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >> ____________________________________________________________________________________ >> >>>>>> >>>>>> >>>>>> >>>>>>>> Need Mail bonding? >>>>>>>> Go to the Yahoo! Mail Q&A for great tips from >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> Yahoo! Answers users. >>>>>>> >>>>>>> >>>>>>> >> http://answers.yahoo.com/dir/?link=list&sid=396546091 >> >>>>>> >>>>>> >>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >> ------------------------------------------------------------------------- >> >>>>>> >>>>>> >>>>>> >>>>>>>> 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=join.php&p=sourceforge&CID=DEVDEV >> >>>>>> >>>>>> >>>>>> >>> _______________________________________________ >>> >>>>>>>> morph-developer mailing list >>>>>>>> mor...@li... >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >>>>>> >>>>>> >>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >> ------------------------------------------------------------------------- >> >>>>>> >>>>>> >>>>>> >>>>>>> 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=join.php&p=sourceforge&CID=DEVDEV >> >>>>>> >>>>>> >>>>>> >>> _______________________________________________ >>> >>>>>>> morph-developer mailing list >>>>>>> mor...@li... >>>>>>> >>>>>>> >>>>>>> >>>>>>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >> ____________________________________________________________________________________ >> >>>>>> Expecting? Get great news right away with email >>>>>> >>>> Auto-Check. >>>> >>>>>> Try the Yahoo! Mail Beta. >>>>>> >>>>>> >> http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html >> >>>>>> >> ------------------------------------------------------------------------- >> >>>>>> 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=join.php&p=sourceforge&CID=DEVDEV >> >>>>>> _______________________________________________ >>>>>> morph-developer mailing list >>>>>> mor...@li... >>>>>> >>>>>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >>>>>> >>>>>> >>>>>> >>>>> >> ------------------------------------------------------------------------- >> >>>>> 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=join.php&p=sourceforge&CID=DEVDEV >> >>>>> _______________________________________________ >>>>> morph-developer mailing list >>>>> mor...@li... >>>>> >>>>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >>>>> >>>>> >> ------------------------------------------------------------------------- >> >>>> 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=join.php&p=sourceforge&CID=DEVDEV> >> >>> _______________________________________________ >>> >>>> morph-developer mailing list >>>> mor...@li... >>>> >>>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >>> >>> >>> >> ____________________________________________________________________________________ >> >>> Finding fabulous fares is fun. >>> Let Yahoo! FareChase search your favorite travel >>> sites to find flight and hotel bargains. >>> http://farechase.yahoo.com/promo-generic-14795097 >>> >>> >>> >> ------------------------------------------------------------------------- >> >>> 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=join.php&p=sourceforge&CID=DEVDEV >> >>> _______________________________________________ >>> morph-developer mailing list >>> mor...@li... >>> >>> >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >> >> >> >> >> ____________________________________________________________________________________ >> Have a burning question? >> Go to www.Answers.yahoo.com and get answers from real people who know. >> >> ------------------------------------------------------------------------- >> 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=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> morph-developer mailing list >> mor...@li... >> https://lists.sourceforge.net/lists/listinfo/morph-developer >> >> > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > |
From: Matt B. <gud...@ya...> - 2007-04-11 11:39:26
|
I never did. :( Itch factor and all... --- Matt Sgarlata <Mat...@wh...> wrote: > I think this issue died again. As I've thought > about this more, I'm > fine with the change. I don't think we need to > introduce the flag > initially unless we find that test cases start to > fail because some type > of exception other than TransformationException is > thrown. > > I may go ahead and introduce this change myself in > the next couple days, > unless you've already started on it Matt B. I > started working on this > in January then had some doubt about my approach and > put it aside again. > > Matt S > > Matt Sgarlata wrote: > > Awesome, thanks Matt B. > > > > I've given this a lot of thought, and whether or > not to wrap > > exceptions should be based on whether or not the > reflector or > > transformer delegates to some other reflector or > transformer. If > > there is no delegation, then go ahead and wrap the > exceptions because > > that is a Morph class. If there is delegation, > there is a potential > > that the delegate is a user defined object rather > than a Morph object, > > so there should not be runtime exception wrapping. > > > > Matt S > > > > Matt Benson wrote: > >> Gotcha--forgot about the RuntimeException > wrapping > >> issue. Matt, since you've given your blessing > here I > >> can make time to stuff this in, with the behavior > flag > >> you had declared it was your intent to use. I'd > like > >> for Morph to become the indisputably "right" way > to do > >> Java object conversions. ;) > >> > >> -Matt > >> > >> --- Matt Benson <gud...@ya...> wrote: > >> > >> > >>> Did I/we lose track of something? I can't > recall > >>> that > >>> there are any outstanding patches from Ben that > >>> haven't been applied to HEAD. And yes, we > should > >>> probably do a release sometime in the near > future > >>> IMHO... :| > >>> > >>> -Matt > >>> > >>> --- Matt Sgarlata > >>> <Mat...@wh...> wrote: > >>> > >>> > >>>> Hi Alan - the patches will either be accepted > or > >>>> modified and then > >>>> accepted. I promise we will do this before the > >>>> > >>> next > >>> > >>>> Morph release. > >>>> > >>>> So when is the next Morph release? Well, as > you > >>>> > >>> can > >>> > >>>> tell, they aren't > >>>> very frequent. The main reason is that I do > >>>> software development as a > >>>> full time job, so Morph isn't really a hobby in > >>>> quite the same way as it > >>>> used to be. If Matt B starts to push for a > >>>> > >>> release, > >>> > >>>> I will chip in and > >>>> make sure the patches are either accepted or > >>>> accepted and modified > >>>> before the release. > >>>> > >>>> Matt S > >>>> > >>>> Alan Stewart wrote: > >>>> > >>>>> Hi > >>>>> I'm a user of Dozer and wanted to know if the > >>>>> > >>>> changes Ben Alex suggested > >>>> > >>>>> will be incorporated into Morph and if so, > when? > >>>>> Regards > >>>>> Alan > >>>>> > >>>>> Matt Benson wrote: > >>>>> > >>>>> > >>>>>> --- Matt Sgarlata > >>>>>> <Mat...@wh...> > >>>>>> > >>> wrote: > >>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> Cool idea! Where are you headed with this? > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>> If I tell you, I'm deprived of my > >>>>>> > >>> curtain-pulling > >>> > >>>>>> ta-da moment... But since you're asking, I'll > >>>>>> > >>>> tell > >>>> > >>>>>> you: > >>>>>> > >>>>>> Dozer is the other OSS object-conversion > >>>>>> > >>>> framework > >>>> > >>>>>> that anyone knows about that has enough meat > to > >>>>>> > >>>> be > >>>> > >>>>>> viable for real work. A lot of people > probably > >>>>>> wouldn't switch from Dozer to Morph if they > >>>>>> > >>>> perceived > >>>> > >>>>>> themselves as losing anything in the way of > >>>>>> functionality. Dozer's primary configuration > >>>>>> interface is an XML resource. Morph on the > >>>>>> > >>> other > >>> > >>>> hand > >>>> > >>>>>> must be configured entirely programmatically > or > >>>>>> Spring-wired. What I have been working on > >>>>>> > >>> these > >>> > >>>> past > >>>> > >>>>>> couple of weeks is a means of mapping > >>>>>> > >>> properties > >>> > >>>> using > >>>> > >>>>>> a configuration format specific to Morph. > Wow, > >>>>>> > >>>> you > >>>> > >>>>>> say sarcastically... But there's more! :) > I > >>>>>> > >>>> can > >>>> > >>>>>> already build simple configuration-file > driven > >>>>>> > >>>> copiers > >>>> > >>>>>> composed of > >>>>>> > >>> PropertyNameMapping/MatchingCopiers, > >>> > >>>> so my > >>>> > >>>>>> next step was, in true me-too fashion, to be > >>>>>> > >>> able > >>> > >>>> to > >>>> > >>>>>> map complex properties (Dozer does this). I > >>>>>> > >>>> -believe- > >>>> > >>>>>> the only thing I needed here was to implement > a > >>>>>> reflector capable of interpreting complex > >>>>>> > >>>> properties > >>>> > >>>>>> (done), and set that as the reflector on my > >>>>>> > >>>> generated > >>>> > >>>>>> PropertyNameMappingCopiers, but I haven't > done > >>>>>> > >>>> this > >>>> > >>>>>> yet. > >>>>>> > >>>>>> Is that all? Of course not! What's cool > about > >>>>>> > >>>> simply > >>>> > >>>>>> duplicating someone else's functionality? > Only > >>>>>> > >>>> if you > >>>> > >>>>>> can one-up them in some way do you come out > >>>>>> > >>>> ahead. > >>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> :) Example: ever since I began working > with > >>>>>>> > >>>> Dozer, > >>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>> they provided a unidirectional mapping > feature. > >>>>>> > >>>>>> However, the one direction was only from > "class > >>>>>> > >>>> A" to > >>>> > >>>>>> "class B"--a limitation (the Dozer team > >>>>>> > >>>> recognizes it > >>>> > >>>>>> as such). This was tedious to define in > their > >>>>>> > >>>> XML > >>>> > >>>>>> format so they still, as far as I know, > haven't > >>>>>> > >>>> done > >>>> > >>>>>> it. XML is clunky anyway. So what I am > >>>>>> > >>> working > >>> > >>>> on is > >>>> > >>>>>> a custom (ANTLR-implemented) DSL for Morph > >>>>>> > >>>> property > >>>> > >>>>>> mapping. > >>>>>> > >>>>>> Example 1: basic mapping > >>>>>> > >>>>>> net.sf.morph.transform.copiers.dsl.test.A : > >>>>>> net.sf.morph.transform.copiers.dsl.test.B { > >>>>>> *, > >>>>>> stringA : stringB, > >>>>>> intA : intB, > >>>>>> objectA : objectB > >>>>>> } > >>>>>> > >>>>>> The above signifies a bidirectional mapping > >>>>>> association between two classes. The > asterisk > >>>>>> signifies that matching property names will > be > >>>>>> > >>>> copied, > >>>> > >>>>>> and that the three paired mappings will be > >>>>>> > >>> made. > >>> > >>>>>> Example 2: mapping some fields leftward only > >>>>>> > >>>> (Dozer > >>>> > >>>>>> can only do rightward) > >>>>>> > >>>>>> net.sf.morph.transform.copiers.dsl.test.A : > >>>>>> net.sf.morph.transform.copiers.dsl.test.B { > >>>>>> *, > >>>>>> stringA<=stringB, > >>>>>> intA<=intB, > >>>>>> objectA<=objectB > >>>>>> } > >>>>>> > >>>>>> As above, the matching properties will be > >>>>>> > >>> mapped. > >>> > >>>> The > >>>> > >>>>>> explicitly defined properties only go from > >>>>>> > >>> class > >>> > >>>> B to > >>>> > >>>>>> class A. To specify all mapping to be > leftward > >>>>>> > >>>> only, > >>>> > >>>>>> the class association can be defined with <= > . > >>>>>> > >>>> As you > >>>> > >>>>>> would expect, => indicates rightward > mappings. > >>>>>> > >>>>>> There are other little things but that's the > >>>>>> > >>> jist > >>> > >>>> of > >>>> > >>>>>> it, anyway. I'm hoping this will ease the > >>>>>> > >>>> transition > >>>> > >>>>>> of hypothetical users from Dozer to Morph. > ;) > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> One thing I worry about is that we may be > >>>>>>> introducing circular > >>>>>>> dependencies. Languages depend on > converters > >>>>>>> > >>>> which > >>>> > >>>>>>> in turn depend on > >>>>>>> reflectors. If we make a reflector that is > >>>>>>> dependent on a language I > >>>>>>> wonder if that could get us into trouble. > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>> I hear you, but composition is such an > integral > >>>>>> > >>>> part > >>>> > >>>>>> of Morph's architecture that I just don't see > a > >>>>>> > >>>> lot of > >>>> > >>>>>> danger here. As you can see, my intent is to > >>>>>> > >>>> make it > >>>> > >>>>>> even deeper! I want to make a > delegatingCopier > >>>>>> > >>>> that > >>>> > >>>>>> depends on propertyCopiers that depend on > >>>>>> > >>>> reflectors > >>>> > >>>>>> that depend on languages that depend on > >>>>>> > >>>> reflectors... > >>>> > >>>>>> I think that's right. :) Ultimately I think > >>>>>> > >>>> that > >>>> > >>>>>> yes, if you misconfigure Morph it will fail > >>>>>> spectacularly. That seems to me more likely > >>>>>> > >>> than > >>> > >>>> for > >>>> > >>>>>> it to misbehave subtly. Anyway, I am doing > my > >>>>>> DSLDefinedCopier in the sandbox, so hopefully > >>>>>> > >>>> I'll > >>>> > >>>>>> have something to check in later this week > for > >>>>>> > >>>> your > >>>> > >>>>>> perusal. Incidentally, if you have a better > >>>>>> > >>> name > >>> > >>>> than > >>>> > >>>>>> DSLDefinedCopier, I'm all ears. :) > >>>>>> > >>>>>> -Matt B > >>>>>> > >>>>>> > >>>>>> > >>>>>>> Matt S > >>>>>>> > >>>>>>> Matt Benson wrote: > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>>> I've just implemented a reflector over > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> SimpleLanguage, > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>>> which is of course itself implemented over > >>>>>>>> > >>> the > >>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> basic > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>>> reflectors. Trust me, this is going > >>>>>>>> > >>>> somewhere... > >>>> > >>>>>>>> Incidentally, the tests for > >>>>>>>> SimpleLanguageBeanReflector implement the > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> long-overdue > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>>> testing of SimpleLanguage.set(). :) > >>>>>>>> > >>>>>>>> more later, > >>>>>>>> Matt (B) > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >> > ____________________________________________________________________________________ > >> > >>>>>> > >>>>>> > >>>>>> > >>>>>>>> Need Mail bonding? > >>>>>>>> Go to the Yahoo! Mail Q&A for great tips > from > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> Yahoo! Answers users. > >>>>>>> > >>>>>>> > >>>>>>> > >> > http://answers.yahoo.com/dir/?link=list&sid=396546091 > >> > >>>>>> > >>>>>> > >>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >> > ------------------------------------------------------------------------- > >> > >>>>>> > >>>>>> > >>>>>> > >>>>>>>> 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=join.php&p=sourceforge&CID=DEVDEV > >> > >>>>>> > >>>>>> > >>>>>> > >>> _______________________________________________ > >>> > >>>>>>>> morph-developer mailing list > >>>>>>>> mor...@li... > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >>>>>> > >>>>>> > >>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >> > ------------------------------------------------------------------------- > >> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> 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=join.php&p=sourceforge&CID=DEVDEV > >> > >>>>>> > >>>>>> > >>>>>> > >>> _______________________________________________ > >>> > >>>>>>> morph-developer mailing list > >>>>>>> mor...@li... > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >> > ____________________________________________________________________________________ > >> > >>>>>> Expecting? Get great news right away with > email > >>>>>> > >>>> Auto-Check. > >>>> > >>>>>> Try the Yahoo! Mail Beta. > >>>>>> > >>>>>> > >> > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > >> > >>>>>> > >> > ------------------------------------------------------------------------- > >> > >>>>>> 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=join.php&p=sourceforge&CID=DEVDEV > >> > >>>>>> > _______________________________________________ > >>>>>> morph-developer mailing list > >>>>>> mor...@li... > >>>>>> > >>>>>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >>>>>> > >>>>>> > >>>>>> > >>>>> > >> > ------------------------------------------------------------------------- > >> > >>>>> 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=join.php&p=sourceforge&CID=DEVDEV > >> > >>>>> > _______________________________________________ > >>>>> morph-developer mailing list > >>>>> mor...@li... > >>>>> > >>>>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >>>>> > >>>>> > >> > ------------------------------------------------------------------------- > >> > >>>> 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=join.php&p=sourceforge&CID=DEVDEV> > >> > >>> _______________________________________________ > >>> > >>>> morph-developer mailing list > >>>> mor...@li... > >>>> > >>>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >>> > >>> > >>> > >> > ____________________________________________________________________________________ > >> > >>> Finding fabulous fares is fun. > >>> Let Yahoo! FareChase search your favorite travel > >>> sites to find flight and hotel bargains. > >>> > http://farechase.yahoo.com/promo-generic-14795097 > >>> > >>> > >>> > >> > ------------------------------------------------------------------------- > >> > >>> 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=join.php&p=sourceforge&CID=DEVDEV > >> > >>> _______________________________________________ > >>> morph-developer mailing list > >>> mor...@li... > >>> > >>> > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >> > >> > >> > >> > >> > ____________________________________________________________________________________ > >> Have a burning question? > >> Go to www.Answers.yahoo.com and get answers from > real people who know. > >> > >> > ------------------------------------------------------------------------- > >> 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=join.php&p=sourceforge&CID=DEVDEV > >> _______________________________________________ > >> morph-developer mailing list > >> mor...@li... > >> > https://lists.sourceforge.net/lists/listinfo/morph-developer > >> > >> > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > 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=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > morph-developer mailing list > > mor...@li... > > > https://lists.sourceforge.net/lists/listinfo/morph-developer > > > > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > ____________________________________________________________________________________ Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html |
From: Matt S. <Mat...@wh...> - 2007-04-12 17:05:33
|
I have an initial implementation that allows RuntimeException wrapping to be turned off. I added to BaseTransformer: protected boolean isWrappingRuntimeExceptions() { return true; } As you can see, I opted to wrap RuntimeExceptions by default. As I've thought about this problem over the past few months, I've decided that BaseTransformer is meant to be an implementation helper and one of the things it does is take potentially ugly Exceptions and wrap them in nice TransformationExceptions with comprehensible English error messages. This is one of the major benefits I think Morph has over BeanUtils: Morph exceptions have their own hierarchy and sensible English messages, as opposed to just rethrowing underlying JDK errors. So, if someone new to Morph writes a simple converter extended from BaseTransformer, he or she automatically gets this behavior. If the user wants to deal with his or her own exceptions, it's easy to override this method and set isWrappingRuntimeExceptions to false. Beyond this, I also went through every Transformer in Morph and overrode this method, even if the override also returns true. That way, if we decide to change the default behavior to return false, no transformers will break. For basic converters like TextToNumberConverter I set this to true (the converter is included with Morph, so it should throw Morph exceptions!). For transformers that delegate to other transformers like SimpleDelegatingTransformer, PropertyNameMatchingCopier and ContainerCopier, I set this to false, since these transformers don't do any real transformations themselves, they just delegate to other (potentially user-defined) transformers. Matt Benson, Ben Alex, Alan Stewart - what do you all think? I'm going to hold off on checking this in for a few hours to make sure it sits well with me and anyone else out there who's reading the list. Matt S |
From: Matt B. <gud...@ya...> - 2007-04-12 17:28:16
|
Hi, Matt--I am fine with this. -Matt B --- Matt Sgarlata <Mat...@wh...> wrote: > I have an initial implementation that allows > RuntimeException wrapping > to be turned off. I added to BaseTransformer: > > protected boolean isWrappingRuntimeExceptions() > { > return true; > } > > As you can see, I opted to wrap RuntimeExceptions by > default. As I've > thought about this problem over the past few months, > I've decided that > BaseTransformer is meant to be an implementation > helper and one of the > things it does is take potentially ugly Exceptions > and wrap them in nice > TransformationExceptions with comprehensible English > error messages. > This is one of the major benefits I think Morph has > over BeanUtils: > Morph exceptions have their own hierarchy and > sensible English messages, > as opposed to just rethrowing underlying JDK errors. > So, if someone new > to Morph writes a simple converter extended from > BaseTransformer, he or > she automatically gets this behavior. If the user > wants to deal with > his or her own exceptions, it's easy to override > this method and set > isWrappingRuntimeExceptions to false. > > Beyond this, I also went through every Transformer > in Morph and overrode > this method, even if the override also returns true. > That way, if we > decide to change the default behavior to return > false, no transformers > will break. For basic converters like > TextToNumberConverter I set this > to true (the converter is included with Morph, so it > should throw Morph > exceptions!). For transformers that delegate to > other transformers like > SimpleDelegatingTransformer, > PropertyNameMatchingCopier and > ContainerCopier, I set this to false, since these > transformers don't do > any real transformations themselves, they just > delegate to other > (potentially user-defined) transformers. > > Matt Benson, Ben Alex, Alan Stewart - what do you > all think? I'm going > to hold off on checking this in for a few hours to > make sure it sits > well with me and anyone else out there who's reading > the list. > > Matt S > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > morph-developer mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-developer > ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 |