From: Stewart T. <wsr...@ho...> - 2005-03-03 11:26:14
|
Brett, If you regard all of the "classes" on the domain object model as being implemented as Java "interfaces", with a separate implementation class (or more than one!) then you'll be well on the way to achieving the independence suggested. In practical terms method parameters and returns for non simple data types are expressed with the Interface name rather than the Class name. Stewart >From: "Brett Lentz" <wak...@ea...> >Reply-To: rai...@li... >To: rai...@li... >Subject: Re: [Rails-devel] Java style point >Date: Wed, 02 Mar 2005 18:04:53 -0800 > >I think this is a good direction to take. > >Are you able to submit some code to move us in that direction? > > >---Brett. > >*********** REPLY SEPARATOR *********** > >On 3/2/2005 at 10:12 PM Iain Adams using ia...@co... >declared: > > >I suggested in a previous post using interfaces for primary datatype > >definitions: one example of how this is done can be found in the Java > >Collections framework. Here List is an interface which has a number of > >implementation classes, which differ in their internal representations: > >ArrayList LinkedList, etc. StockMarket.getIpoPile() has a return type of > >ArrayList - this class should be free to change its list representation > >without an API change, which can be achieved by declaring the method to > >return a List. Personally, I would also make the member variable ipoPile >be > >type List, and initialise it as a 'new ArrayList()' in the first >instance. > > > >Iain. > > > > > > > >------------------------------------------------------- > >SF email is sponsored by - The IT Product Guide > >Read honest & candid reviews on hundreds of IT Products from real users. > >Discover which products truly live up to the hype. Start reading now. > >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > >_______________________________________________ > >Rails-devel mailing list > >Rai...@li... > >https://lists.sourceforge.net/lists/listinfo/rails-devel > > >********** REPLY SEPARATOR END ********** >This message sent with 100% recycled electrons. > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_ide95&alloc_id396&op=click >_______________________________________________ >Rails-devel mailing list >Rai...@li... >https://lists.sourceforge.net/lists/listinfo/rails-devel |