Google Groups Home
Help | Sign in
hkit interface challenges
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all
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
Drew McLellan  
View profile
 More options Jan 15, 5:04 am
From: Drew McLellan <drew.mclel...@gmail.com>
Date: Tue, 15 Jan 2008 02:04:06 -0800 (PST)
Local: Tues, Jan 15 2008 5:04 am
Subject: hkit interface challenges
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.
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:


    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.
Drew McLellan  
View profile
 More options Jan 15, 4:43 pm
From: Drew McLellan <drew.mclel...@gmail.com>
Date: Tue, 15 Jan 2008 13:43:11 -0800 (PST)
Local: Tues, Jan 15 2008 4:43 pm
Subject: Re: hkit interface challenges
On Jan 15, 7:13 pm, "Jeff McNeill" <j...@jeffmcneill.com> wrote:

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

Both as an option, or only an array when rel values are present?

My concern there would in be making the interface predictable. If URL
can sometimes be just a value and sometimes an array with a 'value'
key, the user needs to write code that expects that (or fail to do so
and have their code break).

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.
Jeff McNeill  
View profile
 More options Jan 15, 5:28 pm
From: "Jeff McNeill" <j...@jeffmcneill.com>
Date: Tue, 15 Jan 2008 12:28:43 -1000
Local: Tues, Jan 15 2008 5:28 pm
Subject: Re: [hkit-discuss] Re: hkit interface challenges
Hi Drew,

You are right, predictability is better. The array every time would be
more predictable.

Cheers,

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

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


    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.
Drew McLellan  
View profile
 More options Jan 17, 6:38 am
From: Drew McLellan <drew.mclel...@gmail.com>
Date: Thu, 17 Jan 2008 03:38:27 -0800 (PST)
Local: Thurs, Jan 17 2008 6:38 am
Subject: Re: hkit interface challenges
Does anyone have any further thoughts on this? Is it ok to change the
interface and potentially make it harder for current users to upgrade?

I'm all for it at the moment, with a view to locking things down for
version 1.0.

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.
Steve Ivy  
View profile
 More options Jan 17, 7:28 am
From: "Steve Ivy" <steve...@gmail.com>
Date: Thu, 17 Jan 2008 05:28:26 -0700
Local: Thurs, Jan 17 2008 7:28 am
Subject: Re: [hkit-discuss] Re: hkit interface challenges
Hi Drew,

Not having a lot of dependant code right now, I'm all for it ;-)

--Steve

On Jan 17, 2008 4:38 AM, Drew McLellan <drew.mclel...@gmail.com> wrote:

> Does anyone have any further thoughts on this? Is it ok to change the
> interface and potentially make it harder for current users to upgrade?

> I'm all for it at the moment, with a view to locking things down for
> version 1.0.

> drew.

--
Steve Ivy
http://redmonk.net // http://diso-project.org
This email is: [ ] bloggable [x] ask first [ ] private

    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.
gareth rushgrove  
View profile
 More options Jan 17, 8:54 am
From: "gareth rushgrove" <gareth.rushgr...@gmail.com>
Date: Thu, 17 Jan 2008 13:54:54 +0000
Local: Thurs, Jan 17 2008 8:54 am
Subject: Re: [hkit-discuss] Re: hkit interface challenges
On 1/17/08, Drew McLellan <drew.mclel...@gmail.com> wrote:

> Does anyone have any further thoughts on this? Is it ok to change the
> interface and potentially make it harder for current users to upgrade?

> I'm all for it at the moment, with a view to locking things down for
> version 1.0.

That sounds sensible. With more eyes on the problem the interface is
likely to want to change a little - but aiming for a stable API for a
version 1.0 release is a good plan.

Gareth

> drew.

--
Gareth Rushgrove
garethrushgrove.com
morethanseven.net
getjobsin.com
isitbirthday.com

    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.
Ezra e. k. Cooper  
View profile
 More options Feb 12, 2:39 pm
From: "Ezra e. k. Cooper" <e...@ezrakilty.net>
Date: Tue, 12 Feb 2008 11:39:54 -0800 (PST)
Local: Tues, Feb 12 2008 2:39 pm
Subject: Re: hkit interface challenges
If this topic is still open, I would suggest supporting both, in a
predictable way. In the 'url' field, put an array with all the URLs as
you explained. If there happens to be just one, then also populate a
field 'single_url' with that URL. In many use cases, the caller will
know whether to expect just one, and can use the shortcut 'single_url'
if so. Callers who aren't certain that there will be just one can
consistently use 'url'.

2c,
Ezra


    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.
End of messages
« Back to Discussions « Newer topic     Older topic »

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