Appropriate name for a module to read Mac Resource data 
Author Message
 Appropriate name for a module to read Mac Resource data

I'm contemplating writing a module to access the macintosh resource
data from non-macintosh computers. The format that I would be reading
and writing would be the flattened resource data as found in the
MacBinary, BinHex, and AppleDouble formats.

Right now, I'm thinking that it will be some sort of tied hash
interface, that is "$icon = $resource{ICON}{128}" would get the ICON
resource with ID #128. Maybe for resources with the optional names
attached, something like
 "$string = $resource{'STR '}{NAME}{'Quit Dialog Text'}"

The biggest question in my mind, though seems to be the most
trivial. What should I call it. Since it is dealing with a Macintosh
specific format, that gives some reason for it to go under the Mac::
hierarchy. Something like "Mac::ResourceData". But it isn't accessing
the data the OS's native access methods, (like Mac::Resource does) and
would probably never be used on a Macintosh perl script. Are modules
in a OS's names hierarchy assumed to be only things usable under that
OS?

Another idea would be to put it under the DBM hierarchy,
DBM::MacResource for example. But with the two dimensional hash
lookup, it doesn't really look like a DBM implementation either.

Of course, it could just be its own top level package. "MacResource".

Where would people expect to find a module that performs foreign
access on an OS's native data?

--
Andrew Langmead



Fri, 27 Apr 2001 03:00:00 GMT  
 Appropriate name for a module to read Mac Resource data

Quote:
> I'm contemplating writing a module to access the macintosh resource
> data from non-macintosh computers. The format that I would be reading
> and writing would be the flattened resource data as found in the
> MacBinary, BinHex, and AppleDouble formats.
> The biggest question in my mind, though seems to be the most
> trivial. What should I call it. Since it is dealing with a Macintosh
> specific format, that gives some reason for it to go under the Mac::
> hierarchy. Something like "Mac::ResourceData". But it isn't accessing
> the data the OS's native access methods, (like Mac::Resource does) and
> would probably never be used on a Macintosh perl script. Are modules
> in a OS's names hierarchy assumed to be only things usable under that
> OS?

I don't think so, at least that's not the way I understood "OS-specific".

IMHO "OS-specific" is stuff specific to one OS, but doesn't automatically
imply the OS the stuff runs on.

I'd call it "Mac::ResFork" though (sounds like "ResEdit", isn't that a
good association?), that's much shorter than "Mac::ResourceData", which
BTW violates the 11-character rule for names on CPAN.

Yours sincerely,
--

    Free Perl and C Software for Download: www.engelschall.com/u/sb/download/



Sat, 28 Apr 2001 03:00:00 GMT  
 Appropriate name for a module to read Mac Resource data

Quote:
> I'm contemplating writing a module to access the macintosh resource
> data from non-macintosh computers. Where would people expect to find a
> module that performs foreign access on an OS's native data?

They'd look under that OS first, I think.  So perhaps

   Mac::DecodeResource

If you want to create a new top-level hierarchy, then the most useful
categorization you could have would be something like "FileFormat", so
your module would be

   FileFormat::MacResource

This would imply that some modules need renaming:

   FileFormat::RTF::*           not RTF::*
   FileFormat::MIDI             not MIDI
   FileFormat::SDDF             not SDDF
   ...

But would extend neatly to potential future CPAN submissions like

   FileFormat::PDF
   FileFormat::GIF
   FileFormat::MSWord
   ...

--
Gareth Rees



Sat, 28 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Appropriate way to use NAME with MakeMaker?

2. Authen::Krb5Simple (appropriate name?)

3. Data::MacResFile, cross-platform access to Macintosh resource data

4. Are My Modules Appropriate for CPAN?

5. Assigning resources to text tag names?

6. Compressed data-resources - like java-jars???

7. CGI application incorrectly naming files on MACs

8. Reading data from _DATA_

9. deskcode.com hot new perl resource read more

10. deskcode.com hot new perl resource read more

11. X app resource file not being read?

12. Socket reads hang for some Mac servers.

 

 
Powered by phpBB® Forum Software