abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harris Boyce III" <harris.r.boyce....@gmail.com>
Subject Re: Coding/Language Standards
Date Thu, 28 Sep 2006 15:18:48 GMT
Garrett -

Yeah, shoulda done that to begin with, sorry...OK, from package
org.apache.abdera.model, interface Feed defines these methods:

List<Entry> getEntries();
void addEntry(Entry entry);
...
Entry getEntry(String id);

In .NET, I could define these as properties like this:

List<Entry> Entries {
  get;
  set;
}

And then, normally, I would use the methods exposed by List<Entry> to
perform operations on the Entries (add, remove, etc.).  Now, granted,
I would have to implement a method to retrieve the entry by ID just as
done above.  But I guess my question may be centered around the
encapsulation standards across the languages?  Maybe?

Does that clarify any?  If not, let me know.

Thanks,

H

On 9/28/06, Garrett Rooney <rooneg@electricjellyfish.net> wrote:
> On 9/28/06, Harris Boyce III <harris.r.boyce.iii@gmail.com> wrote:
> > I am looking to have a brief discussion about coding standards in Java
> > and .NET and how they are/should be applied on this project.
> >
> > While studying the code for this project, and other Java porgrams as
> > well, I'm not sure that I understand the premises behind getters and
> > setters and list operation methods (AddEntry, RemoveEntry, etc.).  In
> > .NET, the concept of properties allows the compilers to automatically
> > generate getter and setter methods in-place of what appears to be
> > regular public fields.  What I don't necessarily understand is why
> > list operations are added to objects when the getters and setters
> > expose the list/collection types?  I don't know if this is just a
> > nuance of Java and that .NET developers just don't follow these
> > practices, but I am hoping to receive some insight as to why this
> > practice is followed and whether or not I should do the same in the
> > .NET implemenation of Abdera.
>
> Perhaps your question would be easier to understand if you pointed us
> to a specific example in the code...
>
> -garrett
>

Mime
View raw message