Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I currently work on a large OO project in my day job (not in Perl though). It's certainly true that there's no magic answer about how to deal with a huge application. You just have to familiarize yourself with it, and realize the importance of experience.

That said, I like to either draw diagrams or write things down, or both. Programming is much more reality-based than a lot of people realize (because ultimately anything you code turns into either 0's and 1's or "bytecode" which is, like, weird). One question that I'm always asking when thinking about designing an object is:

What does this object know?

From that the methods and attributes become clear. For example, in the app I'm working on, I created a "table service" object (Powerbuilder calls them objects, but you might refer to them as classes as well).

What does the table service know? It knows:

  • How to add a new table (by giving it a name ie. "table_serv.add_table('#TEMP_TABLE')".
  • How to add columns to the table (ie. a prototype for that function might be "table_serv.add_column(string name, string coltype, bool allow_null)"
  • How to create the table in the database.
  • How to drop said table.
  • How to make a modification to the table's definition.
  • How to insert rows of data into itself.

As it turns out, I did write a table service, but it wasn't quite as ambitious as the list above (ie. I hardcoded the INSERT's in my code, it's not yet a capability of the table service). And this list simplifies it somewhat, because the table service is really a wrapper around an array of table objects, each of which has its own array of column objects. But hopefully you get the idea.

In fact I use this question all the time. I use it for debugging apps, configuring apps, understanding my environment and more.

For example, I had a problem with a web site host (for a site I'm developing for a client) where I would go to www.thedomainiregistered.com and it wouldn't go to the /home/username/public_html/ dir that it should have (instead, it went to a system-wide DocumentRoot, because obviously the admin hadn't yet put my homedir's public_html dir as the DocumentRoot). I thought to myself "Apache should know that when I say www.thedomainiregistered.com it should go to my /home/username/public_html/ directory". In other words, the concept of "who knows what" made me realize that it wasn't a programming problem, but an incompetent Apache admin. As it turns out, I'm in the process of dealing with this being fixed right now. :)


In reply to Re: How to think. by mothra
in thread How to think. by little_mistress

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 contemplating the Monastery: (9)
As of 2024-03-28 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found