Google Groups Home
Help | Sign in
Message from discussion hkit interface challenges
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jeff McNeill  
View profile
 More options Jan 15, 2:13 pm
From: "Jeff McNeill" <j...@jeffmcneill.com>
Date: Tue, 15 Jan 2008 09:13:17 -1000
Local: Tues, Jan 15 2008 2:13 pm
Subject: Re: [hkit-discuss] hkit interface challenges
Hello Drew,

Great effort here. I am wondering if both could be supported?

--
Sincerely,
Jeff McNeill
http://jeffmcneill.com/

On 1/15/08, Drew McLellan <drew.mclel...@gmail.com> wrote:

> Looking for some opinions/advice on how hkit should be developed
> moving forward.

> One of my goals with hkit was always to make the interface (and here I
> guess I'm primarily talking about the output from a parse) easy to use
> for a php coder of pretty much any level. I can recall countless times
> when I've downloaded some library or other only to find that so little
> thought has gone into designing the interface that it's easier to
> write my own version than to figure out how to use the library. Partly
> that comes down to documentation and tutorials, but also it comes down
> to design and using the simplest thing possible.

> This is why hkit outputs a simple array structure, and not a bunch of
> oblique objects. Any novice can print_r() the output and understand
> what they're dealing with. The other advantage is that it becomes
> trivial to convert that array into json - something that is essential
> to maintain.

> That said, as we add more features to the parser, it becomes more of a
> challenge to keep the interface simple.

> I'm trying to figure out the best way to present the @rel values that
> accompany a URL. At present, when an A element with the class of URL
> is found (primarily hCard) the value is represented as:

>     [url] => http://example.com/

> This is obviously very easy to consume. However, if there are
> accompanying rel values we have nowhere to show those. Taking the next
> leap, we could change the interface to represent URL as an array:

>     [url] => Array
>         (
>             [value] => http://example.com/
>             [rel] => Array
>                 (
>                     [0] => friend
>                     [1] => coworker
>                     [2] => met
>                 )

>         )

> The downside here is that for simple cases where $result['url'] would
> have done, $result['url']['value'] must be used.

> Am I worrying too much? I think the tradeoff of the extra complexity
> for simple cases is worth it for the added utility. As hkit users,
> would you agree?

> drew.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google