|
From: Kopylenko, D. <dko...@ac...> - 2004-02-05 16:50:38
|
I'm not a big fan of Ixxx naming pattern for interfaces. +1 for = renaming them to something else. Dmitriy. -----Original Message----- From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...]=20 Sent: Thursday, February 05, 2004 11:45 AM To: spr...@li... Subject: [Springframework-developer] IJdbcTemplate / IHibernateTemplate = / ISqlMapTemplate Everybody, =20 Due to a recent request, I've just extracted IHibernateTemplate and ISqlMapTemplate interfaces, analogous to IJdbcTemplate that Rod = introduced a while ago. They are intended to ease mocking for unit-testing DAOs, for those who want to mock at this level. For typical DAO implementations, = the standard template classes are good enough, allowing for mocks of the underlying persistence tool and live tests against a database. =20 However, I wonder about the naming. We don't have the I* pattern = anywhere else in the framework; on the other hand, we need to keep the old = template names for compatibility (and some templates don't lend themselves for = such an interface, like JdoTemplate). IHibernateTemplate etc doesn't worry = me, but maybe a different name like HibernateOperations would be better? Essentially, those interfaces specify a set of data access operations = for a particular persistence tool. =20 The naming isn't too important, though, as it will not be the main API = that people will work with; the template classes will be. We'll just let the templates implement those operation interfaces to allow for mocking = them if desired. BTW, iBATIS SQL Maps is all based on concrete classes rather = than interfaces, not allowing to mock the persistence tool itself. =20 Juergen =20 ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2004-02-05 17:37:17
|
I used to start my interface names with I, but a year or two ago stopped=20 when I realized that in fact I was almost always working against the=20 interfaces anyways, so it was silly to always have the prefix there (now=20 I generally add 'Impl' to the end of the implementation object, if there=20 is only one variant). The I prefix is not going to be pretty here where most of our other=20 interfaces don't have it, but on the other hand, I don't like interface=20 names which seem to have no relation to the impl. objects either... I=20 would probably leave them as Ixxxx and add a note to the javadoc that it=20 is that way for historical reasons, as opposed to having a totally=20 different interface and impl name... Kopylenko, Dmitry wrote: >I'm not a big fan of Ixxx naming pattern for interfaces. +1 for renaming >them to something else. > >Dmitriy. > >-----Original Message----- >From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...]=20 >Sent: Thursday, February 05, 2004 11:45 AM >To: spr...@li... >Subject: [Springframework-developer] IJdbcTemplate / IHibernateTemplate = / >ISqlMapTemplate > > >Everybody, >=20 >Due to a recent request, I've just extracted IHibernateTemplate and >ISqlMapTemplate interfaces, analogous to IJdbcTemplate that Rod introduc= ed a >while ago. They are intended to ease mocking for unit-testing DAOs, for >those who want to mock at this level. For typical DAO implementations, t= he >standard template classes are good enough, allowing for mocks of the >underlying persistence tool and live tests against a database. >=20 >However, I wonder about the naming. We don't have the I* pattern anywher= e >else in the framework; on the other hand, we need to keep the old templa= te >names for compatibility (and some templates don't lend themselves for su= ch >an interface, like JdoTemplate). IHibernateTemplate etc doesn't worry me= , >but maybe a different name like HibernateOperations would be better? >Essentially, those interfaces specify a set of data access operations fo= r a >particular persistence tool. >=20 >The naming isn't too important, though, as it will not be the main API t= hat >people will work with; the template classes will be. We'll just let the >templates implement those operation interfaces to allow for mocking them= if >desired. BTW, iBATIS SQL Maps is all based on concrete classes rather th= an >interfaces, not allowing to mock the persistence tool itself. >=20 >Juergen >=20 > |
|
From: Rod J. <rod...@in...> - 2004-02-06 07:22:55
|
Come to think of it this is a good argument as well. I don't like XXXXInterface: to me that seems more inelegant than IXXXX. At the end of the day, I don't really care too much. ----- Original Message ----- From: "Colin Sampaleanu" <col...@ex...> To: <spr...@li...> Sent: Thursday, February 05, 2004 5:37 PM Subject: Re: [Springframework-developer] IJdbcTemplate / IHibernateTempla= t e / ISqlMapTemplate I used to start my interface names with I, but a year or two ago stopped when I realized that in fact I was almost always working against the interfaces anyways, so it was silly to always have the prefix there (now I generally add 'Impl' to the end of the implementation object, if there is only one variant). The I prefix is not going to be pretty here where most of our other interfaces don't have it, but on the other hand, I don't like interface names which seem to have no relation to the impl. objects either... I would probably leave them as Ixxxx and add a note to the javadoc that it is that way for historical reasons, as opposed to having a totally different interface and impl name... Kopylenko, Dmitry wrote: >I'm not a big fan of Ixxx naming pattern for interfaces. +1 for renaming >them to something else. > >Dmitriy. > >-----Original Message----- >From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...] >Sent: Thursday, February 05, 2004 11:45 AM >To: spr...@li... >Subject: [Springframework-developer] IJdbcTemplate / IHibernateTemplate = / >ISqlMapTemplate > > >Everybody, > >Due to a recent request, I've just extracted IHibernateTemplate and >ISqlMapTemplate interfaces, analogous to IJdbcTemplate that Rod introduc= ed a >while ago. They are intended to ease mocking for unit-testing DAOs, for >those who want to mock at this level. For typical DAO implementations, t= he >standard template classes are good enough, allowing for mocks of the >underlying persistence tool and live tests against a database. > >However, I wonder about the naming. We don't have the I* pattern anywher= e >else in the framework; on the other hand, we need to keep the old templa= te >names for compatibility (and some templates don't lend themselves for su= ch >an interface, like JdoTemplate). IHibernateTemplate etc doesn't worry me= , >but maybe a different name like HibernateOperations would be better? >Essentially, those interfaces specify a set of data access operations fo= r a >particular persistence tool. > >The naming isn't too important, though, as it will not be the main API t= hat >people will work with; the template classes will be. We'll just let the >templates implement those operation interfaces to allow for mocking them= if >desired. BTW, iBATIS SQL Maps is all based on concrete classes rather th= an >interfaces, not allowing to mock the persistence tool itself. > >Juergen > > ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |