in reply to Re: Help with ADT
in thread Help with ADT

Yes, you are absolutely correct. I should have been more specific in my post.

What I was driving at was that he wasn't quite sure how the ADT was going to be specified. In fact, he says that the ADT's definition is constantly changing. This implies, to me, that he's using this thing. By creating some API, he is able to deal with the ADT in some abstract manner within the client. He gets to figure out what exactly he wants this thing's behavior to be.

Then, and only then, does he have enough information to be able to actually design the darn thing. He's trying to put the cart before the horse.

For example, I only skimmed the original post, but I'm pretty sure that he doesn't need one ADT, but a composition of ADT's.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Help with ADT
by Abigail-II (Bishop) on Jul 25, 2002 at 14:20 UTC
    Well, you wrote:
    The client only does stuff through the accessors, so you don't have the coercion issues.
    which sounds specific enough to me, and that was what I argued against.

    You are right about that it's good to do the design first (if only all programmers would). It's also good to have an API, but that's already implied if you are using an ADT, because it wouldn't be much of an ADT if you'd poke around in the datastructure outside of defined set of functions. However, you do not need objects to be able to deal with ADTs. Your password file can be seen as an ADT which you access via the *pwent set of functions.

    Abigail

      dimmesdale wrote:
      $info->{subdirectory}->{file}->[measurement] = INDEX; $info->{subdirectory}->{file} = PARSER; $info->[measurement]->{name} = NAME;

      That looks very much like "pok(ing) around in the datastructure ..." *shrugs*

      Design, especially before coding, is good.

      Creating mockups in search of knowledge to help design is good.

      Poking around in complex data structures is bad.

      Creating API's to encapsulate complexity is good.

      (I'm starting to feel like a Mastercard commercial.)

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

        Well, you have to poke *somewhere* in your code in your datastructure, otherwise it wouldn't be useful. You can make the most beautiful API, but if you never put something in your datastructure, or never look at something inside it, it's not going to be very useful.

        I don't think the post gave any indication the accessing was done outside of an API. Perhaps it was, but there's no reason to assume it so.

        Not that whether it was done inside or outside an API has anything to do with his problem.

        Abigail