Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I hope this is the right place to post this.

As new as I am to Perl, I am almost as new to databases. But, two ideas that I picked up from working with a database were 1) the "normal form", and 2) the "primary key". As I began to absorb these concepts, the light began to dawn for me, how a database can be used to describe many different views of the same thing, if the designer has been careful to distinguish one thing from another: called "normal form". This enabled me to design queries which produce the various views that are usually requested from a database.

Any of the aspects of the data in multiple rows of a normal form table can be abstracted out for reference in a new relationship, by using the idea of a primary key. I can join the data of two tables together, selecting only the parts that I want to see. This new selection itself can (and should) be "normal form", describing a unique entity on each line and therefore, in turn, adaptable to other uses by applying a primary key to each line of the product of an ad-hoc query.

Now I've come to Perl and my question - actually, to Perl only in a general sense, as a programming language that is adaptable to the "object-oriented" paradigm. I had the idea that in the programming paradigm called "object- oriented", there must be something like a relational database's ability to create various views of an object - "Bessie" viewed as "ground beef". I would expect multiple views to be such that "Bessie" can be followed from calf to cow (one instance of cow becoming another kind of cow), to patties(a cow with all of its cow-methods removed), still identifiable through all these changes, as a specific instance of "cow". But in the end, Bessie now "tastes yummy" and the "speak" and "eat" method is an irrecoverably inapplicable or radically redefined attribute.

It is often the case that a real world object, while retaining some key element of identity, is of interest because it is being made into something else. As the process matures, the beefness of Bessie becomes more important than her cowness. But, it seems to me that a programming object is simply a "cow" or it is not. A "Cow::" cannot become "Beef::" without losing its identity entirely: however, in the real world very many "cows" become "beef". It seems that there is more certainty built into a programming object, than a real-world object. Consequently, there is a limitation built in to how exactly this paradigm can map to the real world.

Brethren, I apologize for how impractical this question is. Maybe I'm missing something really obvious, and 'thinking sophomorically'. But, I'm looking for every handle I can find, so that programming will make more sense to me - and here is a handle that I thought would be there, but seems to be missing. How wrong am I?

mkmcconn


In reply to normal objects? by mkmcconn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-29 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found