in reply to Re^2: Please, review my diagram
in thread Please, review my diagram

Well, I went through the trouble to download through a proxy, scan for viruses .... the class looked very simple, like Point, and the diagram looked machine generated, but it was just a list of key/value pairs --- pdf not required, so I reiterate, you should post code :)

Replies are listed 'Best First'.
Re^4: Please, review my diagram
by usr345 (Sexton) on Jun 13, 2011 at 07:18 UTC

    > the class looked very simple, like Point, and the diagram looked machine generated, but it was just a list of key/value pairs

    It's not a class diagram. It's a try to create an overview of all possible Moose attributes for this doc:

    http://search.cpan.org/~flora/Moose-2.0007/lib/Moose/Manual/Attributes.pod#___top

    Cause in there docs you can't see them all on a single page. And on my diagram you can + a code snippet + some notes.

    -------------------------------------------------------------------------------------------------------

    > pdf not required, so I reiterate, you should post code :)

    The pdf was typeset in LaTeX, using Tikz. You can get the source here:

    http://www.live-wtr.ru/Perl/moose.txt

    The real file extension is .tex

      FWIW, SumatraPDF doesn't show any + to click or anything like that ;) I stick by my statement, you should post here

        1. How to add email notifications for new messages on Perlmonks? I can't find it.

        > doesn't show any + to click or anything like that

        Where should this + sign lead? Can you draw some picture in paint, so I could see, what you expect to see?

        ---------------------------------------------------------------------------------------------------

        > I stick by my statement, you should post here

        I am willing to post, but I have nothing more, then a tex file, that I gave you. Ok, but it's big:

        \documentclass{article} \usepackage[a3paper]{geometry} \usepackage[cm]{fullpage} \usepackage[utf8]{inputenc} \usepackage{listings} \usepackage{verbatim} \usepackage[english]{babel} \usepackage{tikz} \usetikzlibrary{shapes,arrows,backgrounds,calc} \begin{document} \begin{tikzpicture} %{{{ tikz styles \tikzset{ header/.style={ellipse, draw=black, top color=white, bottom color= +yellow!50,thick, inner sep=3mm, minimum size=3em, text centered, doub +le, anchor=west}, pointer/.style = {signal, signal to=east, anchor=west}, mnemonic-block/.style={rectangle, anchor=west, inner sep=3mm}, line/.style = {draw}, comment/.style = {rectangle, rounded corners, draw, inner sep=3mm, + anchor=west, text width = 8cm, node distance=1.5cm}, } %}}} \matrix[nodes={draw}, row sep=5mm, column sep=2mm,minimum width=.875cm, minimum height=1cm] { \node [header] (1_1) {Moose Attributes};\\\node [pointer] (2_1) {read- +write / read only}; & \node [mnemonic-block] (2_2) {\begin{lstlisting}[language=Perl] has 'attr' => {is => 'rw'} has 'attr' => {is => 'ro'} \end{lstlisting}};\\\node [pointer] (3_1) {Accessor methods}; & \node [mnemonic-block] (3_2) {\begin{lstlisting}[language=Perl] has 'attr' => {reader => 'get_attr',} has 'attr' => {writer => 'set_attr',} \end{lstlisting}};\\\node [pointer] (4_1) {Predicate method}; & \node [mnemonic-block] (4_2) {\begin{lstlisting}[language=Perl] has 'attr' => {predicate => 'has_attr'} \end{lstlisting} }; & \node [comment] (4_3) {Tells you whether or not a given attribute +is currently set};\\\node [pointer] (5_1) {Cleaner method}; & \node [mnemonic-block] (5_2) {\begin{lstlisting}[language=Perl] has 'attr' => {cleaner => 'clean_attr'} \end{lstlisting}}; & \node [comment] (5_3) {Unsets the attribute};\\\node [pointer] (6_ +1) {Required}; & \node [mnemonic-block] (6_2) {\begin{lstlisting}[language=Perl] has 'attr' => {required => 1} \end{lstlisting}};\\\node [pointer] (7_1) {Lazy}; & \node [mnemonic-block] (7_2) {\begin{lstlisting}[language=Perl] has 'attr' => {lazy => 1} \end{lstlisting} }; & \node [comment] (7_3) {When lazy is true, the default is not gener +ated until the reader method is called};\\\node [pointer] (8_1) {Cons +tructor parameters}; & \node [mnemonic-block] (8_2) {\begin{lstlisting}[language=Perl] has 'attr' => {init_arg => 'new_name'} \end{lstlisting} }; & \node [comment] (8_3) { Use a different name for the constructor parameter for this at +tribute. };\\\node [pointer] (9_1) {Weak references}; & \node [mnemonic-block] (9_2) {\begin{lstlisting}[language=Perl] has 'attr' => {weak_ref => 1} \end{lstlisting} }; & \node [comment] (9_3) { If you set the weak\_ref option to a true value, then it will +call Scalar::Util::weaken whenever the attribute is set };\\\node [pointer] (10_1) {Trigger}; & \node [mnemonic-block] (10_2) {\begin{lstlisting}[language=Perl] has 'attr' => {trigger => \&attr_set} \end{lstlisting} }; & \node [comment] (10_3) {subroutine that is called whenever the att +ribute is set};\\\node [pointer] (11_1) {Attribute type}; & \node [mnemonic-block] (11_2) {\begin{lstlisting}[language=Perl] has 'attr' => {isa => 'Str',} has 'attr' => {isa => 'MyApp::Weapon',} \end{lstlisting} };\\\node [pointer] (12_1) {Documentation}; & \node [mnemonic-block] (12_2) {\begin{lstlisting}[language=Perl] has 'attr' => {documentation => q{Some text}} \end{lstlisting} };\\ }; \draw[line] (1_1.west) --++ (-5mm, 0) |- (2_1.west) --++ (-5mm, 0) |- +(3_1.west) --++ (-5mm, 0) |- (4_1.west) --++ (-5mm, 0) |- (5_1.west) +--++ (-5mm, 0) |- (6_1.west) --++ (-5mm, 0) |- (7_1.west) --++ (-5mm, + 0) |- (8_1.west) --++ (-5mm, 0) |- (9_1.west) --++ (-5mm, 0) |- (10_ +1.west) --++ (-5mm, 0) |- (11_1.west) --++ (-5mm, 0) |- (12_1.west);\ +draw[line] (2_1.east) -- (2_2.west);\draw[line] (3_1.east) -- (3_2.we +st);\draw[line] (4_1.east) -- (4_2.west);\draw[line] (4_2.east) -- (4 +_3.west);\draw[line] (5_1.east) -- (5_2.west);\draw[line] (5_2.east) +-- (5_3.west);\draw[line] (6_1.east) -- (6_2.west);\draw[line] (7_1.e +ast) -- (7_2.west);\draw[line] (7_2.east) -- (7_3.west);\draw[line] ( +8_1.east) -- (8_2.west);\draw[line] (8_2.east) -- (8_3.west);\draw[li +ne] (9_1.east) -- (9_2.west);\draw[line] (9_2.east) -- (9_3.west);\dr +aw[line] (10_1.east) -- (10_2.west);\draw[line] (10_2.east) -- (10_3. +west);\draw[line] (11_1.east) -- (11_2.west);\draw[line] (12_1.east) +-- (12_2.west); \end{tikzpicture} \end{document}