Thanks Supun and Azeez for the explanations. On Thu, Apr 21, 2011 at 5:56 PM, Afkham Azeez <az...@wso2.com> wrote:
> It would have been even better if there is no setter for the date. > > > On Thu, Apr 21, 2011 at 5:55 PM, Afkham Azeez <az...@wso2.com> wrote: > >> Yeah, better/proper encapsulation. >> >> >> On Thu, Apr 21, 2011 at 5:44 PM, Supun Kamburugamuva <su...@wso2.com>wrote: >> >>> I think it doesn't want to expose the Data object to the outside? >>> >>> Thanks, >>> Supun.. >>> >>> On Thu, Apr 21, 2011 at 4:57 PM, Amila Maha Arachchi <ami...@wso2.com> >>> wrote: >>> > Hi, >>> > >>> > I came across the following code segment. >>> > >>> > public Date getDate() { >>> > return new Date(date.getTime()); >>> > } >>> > >>> > public void setDate(Date date) { >>> > this.date = new Date(date.getTime()); >>> > } >>> > >>> > Any reason for the above implementation instead of >>> > >>> > return date; and >>> > this.date = date; >>> > >>> > Thanks, >>> > AmilaM. >>> > >>> > _______________________________________________ >>> > Carbon-dev mailing list >>> > Carbon-dev@wso2.org >>> > http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev >>> > >>> > >>> >>> >>> >>> -- >>> Supun Kamburugamuva >>> Technical Lead & Product Manager, WSO2 Inc.; http://wso2.com >>> Member, Apache Software Foundation; http://www.apache.org >>> WSO2 Inc.; http://wso2.org >>> E-mail: su...@wso2.com; Mobile: +94 77 431 3585 >>> Blog: http://supunk.blogspot.com >>> _______________________________________________ >>> Carbon-dev mailing list >>> Carbon-dev@wso2.org >>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev >>> >> >> >> >> -- >> *Afkham Azeez* >> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com, >> * >> * >> *Member; Apache Software Foundation; >> **http://www.apache.org/*<http://www.apache.org/> >> * >> email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919 >> blog: **http://blog.afkham.org* <http://blog.afkham.org>* >> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> >> * >> linked-in: **http://lk.linkedin.com/in/afkhamazeez* >> * >> * >> *Lean . Enterprise . Middleware* >> >> > > > -- > *Afkham Azeez* > Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com, > * > * > *Member; Apache Software Foundation; > **http://www.apache.org/*<http://www.apache.org/> > * > email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919 > blog: **http://blog.afkham.org* <http://blog.afkham.org>* > twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> > * > linked-in: **http://lk.linkedin.com/in/afkhamazeez* > * > * > *Lean . Enterprise . Middleware* > > > _______________________________________________ > Carbon-dev mailing list > Carbon-dev@wso2.org > http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev > >
_______________________________________________ Carbon-dev mailing list Carbon-dev@wso2.org http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev