brnzn wrote:
> Why does the API not provide a Person object that we can populate and
> then pass in to be persisted?  Perhaps something like this:
> 
>       Person p = new Person("Bernie");
>       p.addGroupMembership("My Contacts");
> 
>       getContentResolver().insert(Person.CONTENT_URI, p);
> 
> The Person class tells clearly us:
> 1. What values can be set (by the existence of bean properties)
> 2. What datatype each property is
> 3. What values are are mandatory (probably by virtue of them being
> required in constructor calls)
> 
> Is it a classloading issue?  I'm guessing no because we could easily
> overcome that by making Person Serializable or Parcelable, splitting
> it out into a JAR to be linked into whatever app needs it.
> 
> So what then is the philosophy that has driven the architecture to be
> this way?

I can't speak for the core Android team, so I cannot say specifically
why they made the design decision.

However, given their repeated insistence that they will not break binary
interfaces with Android OS updates, my guess is that's at least part of
their rationale. The definition of a "contact" has potential to change
significantly. They may feel that a more generic interface will help
them expand the scope of contacts without changing existing uses of the API.

To draw an analogy, it's a variant on the strong-vs.-weak typing
argument you see when Rubyists and Javanauts square off. Strong typing
has definite benefits, in terms of compile-time validations and
potential for optimization. However, strong typing can also "get in the
way", which is why some folk prefer weakly-typed or type-inferred languages.

Anyway, that's my guess. Take it with a grain of salt. Preferably a
large grain of salt, maybe one cubic foot or so... ;-)

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Published!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to