However, is it the "norm / acceptable", as above, to check the argument and based on a value then modify it.

It is acceptable to modify any attributes based on arguments

They say the user of a class shouldn't know/care about the internal state of attributes -- attributes are an implementation detail for the writer of a class

so as the writer of a class do what makes sense, but as the user of a class pretend you don't know how it works inside (hard I know)

smart people say: design a class the way you want to use it, start by writing code that uses it first

perlootut, Modern Perl, Moo

OR, is it better/normal to create a "blank" instance and then pass that into another method to change/modify?

That depends, does the change/modification happen only once, during object creation? Or can it happen at any time in the life of the object?

If you allow the user of your class to modify user/pass after object instantiation, and some other attribute depends on user/pass , then its best to encapsulate this relationship in a seperate method

Instead of allowing ->change_username and ->change_password, call it ->change_userpass, and document that it affects the value of append_text

But most likely you'll simply want to stick with doing this in the constructor -- and not allow changing of user/pass after instantiation

OR, the third option: I am getting way to bogged down on what is the "norm" and I should worry more about my apparent lack of understanding of how OOP works!

This! I recognize you as a one-of-us who doesn't really understand how OOP works :)

This question is more of a low-level detail and you're not going to ferret out any benefits/tradeoffs/caveats... to find the best approach in this project -- its just not big enough and this detail is very low level

No matter what you do, you're going to get it wrong, so you might as well get on with it, write your code (deliver product), make your mistakes, and learn from them :)

The part you're probably missing
Class-responsibility-collaboration card
GRASP (object-oriented design)
OOP in the Real World - Creating an Equation Editor - CodeProject
How I explained OOD to my wife - CodeProject
A Simple Example of Object-Oriented Design: An Address Book and An Example of Object-Oriented Design: An ATM Simulation ; tarballs at http://www.cs.gordon.edu/courses/cs211/
Story-driven modeling


In reply to Re^3: High level OOP query (internal data) by Anonymous Monk
in thread High level OOP query by packetstormer

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.