eclipse: need example code, or any OO example code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence

    eclipse: need example code, or any OO example code

    I've downloaded and am now studying the Eclipse class libary. It looks
    very elegant and well done. But as I am somewhat new to OO, I'd like
    to see some example code. Documentation is thin, save that generated
    by PHPdocs.

    Can anyone show me some sample code? I'm mostly interested in how
    other people set up their software - what objects call what objects?
    What are other programmers doing in their web projects? Is it common
    for people to mix OO and procedural code in their web projects? Those
    who've gone the pure OO route, can I see the constructor for your main
    object?
  • lawrence

    #2
    Re: eclipse: need example code, or any OO example code

    "rush" <pipa@rush.aval on.hr> wrote in message[color=blue]
    > Where MySitePage defines, things that are common fro every page on your
    > site, UserPage adds things specific to the part of the site for users, etc..
    > You can also use classes to define components that get used on many pages,
    > like page counters, or menu.
    >
    > You could find some simple examples of the pages on the TT page. (maybe I
    > will add some more describing some possible organizations of the app, it
    > sounds like a good idea).[/color]

    I like the sound of your IDE, but what language is it in? Will it run
    on a Windows PC?

    Comment

    • rush

      #3
      Re: eclipse: need example code, or any OO example code

      "lawrence" <lkrubner@geoci ties.com> wrote in message
      news:da7e68e8.0 307111131.3035f b4b@posting.goo gle.com...[color=blue]
      > "rush" <pipa@rush.aval on.hr> wrote in message
      > I like the sound of your IDE, but what language is it in? Will it run
      > on a Windows PC?[/color]

      IDE runs on windows, and let's you use and generate PHP 4.x code, and you do
      not need anything speciall on the server besides regular html server with
      PHP support.

      On the windows development machine you will also need html server with php,
      and Internet explorer if you would like to preview generated pages. The IDE
      itself is written in Smalltalk (but this is just language it is implemented
      in, like for instance your favouriute editor is perhaps implemented in C but
      it lets you write php source code).

      If youhave any further questions please do not hesitate to contact me,

      rush
      --




      Comment

      • lawrence

        #4
        Re: eclipse: need example code, or any OO example code

        "rush" <pipa@rush.aval on.hr> wrote in message news:<berqr2$87 kv$1@as201.hine t.hr>...[color=blue]
        > "lawrence" <lkrubner@geoci ties.com> wrote in message
        > news:da7e68e8.0 307121857.7c9e3 d9@posting.goog le.com...[color=green]
        > > "rush" <pipa@rush.aval on.hr> wrote in message
        > > I've tried it out some. I like its complete listing of all functions
        > > and classes. But it lacks certain basic text editing abilities, like
        > > to indent a block of code.[/color]
        >
        > hm.., you select the code and press the tab (or shift tab if you would like
        > to un-indent), if that is what you need? Also columl selection (rectangular)
        > can be done by holting an alt key and selecting with mouse. Maybe it is not
        > bad idea to add this to the faq.[/color]

        Ah, I was looking around for a button or something. Thanks much. I'm
        testing it out today. What is in the professional version?

        Comment

        • rush

          #5
          Re: eclipse: need example code, or any OO example code

          "lawrence" <lkrubner@geoci ties.com> wrote in message
          news:da7e68e8.0 307131029.7711b 9e4@posting.goo gle.com...[color=blue]
          > "rush" <pipa@rush.aval on.hr> wrote in message[/color]
          news:<berqr2$87 kv$1@as201.hine t.hr>...[color=blue]
          > Ah, I was looking around for a button or something. Thanks much. I'm
          > testing it out today. What is in the professional version?[/color]

          functionality wide it is a same thing, the only difference is that it does
          not include promo dialog box for pro version, and it does not include TT
          footer on the generated pages.

          rush
          --




          Comment

          • Phil Roberts

            #6
            Re: eclipse: need example code, or any OO example code

            With total disregard for any kind of safety measures
            lkrubner@geocit ies.com (lawrence) leapt forth and uttered:
            [color=blue]
            > I've downloaded and am now studying the Eclipse class libary. It
            > looks very elegant and well done. But as I am somewhat new to
            > OO, I'd like to see some example code. Documentation is thin,
            > save that generated by PHPdocs.
            >
            > Can anyone show me some sample code? I'm mostly interested in
            > how other people set up their software - what objects call what
            > objects? What are other programmers doing in their web projects?
            > Is it common for people to mix OO and procedural code in their
            > web projects? Those who've gone the pure OO route, can I see the
            > constructor for your main object?[/color]

            Are you referring to the Eclipse library by Vincent Oostindie?

            Its not particularly hard to use as the Iterator and Database
            classes work the same way across the board.

            Heres an example using a MySQL database:

            <?php

            include_once('./MyDatabase.php' );
            include_once('./QueryIterator.p hp');

            $db =& new MyDatabase('db_ name', 'localhost');

            if (!$db->connect('db_us er', 'db_pass')) {
            die('Database error: ' . $db->getErrorMessag e());
            }

            $query =& $db->query('SELEC T * FROM table');

            if($query->isSuccess()) {
            for($it =& new QueryIterator($ query); $it->isValid(); $it->next()) {
            $data =& $it->getCurrent() ;
            echo $data['column_name'];
            }
            } else {
            die('Query error: ' . $query->getErrorMessag e());
            }

            ?>

            Using the array iterator is the same sort of thing:

            <?php

            include_once('./ArrayIterator.p hp');

            $array = $_SERVER; // Just as an example

            for($it =& new ArrayIterator($ array); $it->isValid(); $it->next()) {
            $data =& $it->getCurrent() ;
            echo $data['key'];
            }

            ?>

            --
            There is no signature.....

            Comment

            • lawrence

              #7
              Re: eclipse: need example code, or any OO example code

              Phil Roberts <philrob@HOLYfl atnetSHIT.net> wrote in message[color=blue]
              > A good place to go to pick up information about the Eclipse library
              > is http://sitepointforums.com/, as until recently the author was a
              > fairly regular poster there. Heres one particular thread where he
              > goes into a lot of detail about OOP in general and throws some
              > examples from Eclipse into the mix:
              >
              > http://sitepointforums.com/showthrea...threadid=59898[/color]

              Outstanding information on that page, especially by the Eclipse
              author. I find that looking at the code of Eclipse is like getting a
              free education in truly good OOP thinking. I often have trouble
              reading other people's code, but his code is unusually simple and
              elegant.

              Thanks for the tip.

              Comment

              Working...