Model View Controller (MVC) design pattern - PDF by sae11431

VIEWS: 0 PAGES: 5

									                                        Java



                        "       !
                                                          "    #                             $




&                       #                           JAVA                        ##       %
"       # # '#                                     & !                      &        #           #
                                                                        &
                                                                                     " !
                   Model View Controller (MVC) design pattern
                                        ##             "Model - View - Controller design pattern
        Model                                         (    "                   ! !
                                         "                      Controller                View
    "                                               %    %           ")          !

                                             Java Swing
*                           %   "                          &Java                #       #
                                                                      &Java Swing Tutorial
              &http://java.sun.com/docs/books/tutorial/uiswing/components/components.html
                                                          "GUI         ( !     #

                                        Javadoc
             #      #                          %        Java        #               Javadoc
         Javadoc                    "              !                          %         "Java
                        ( !                               !          http://java.sun.com/javadoc
                                                                                        "




                                                    1
                                                Java Coding Conventions                 (        $
                                   "http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
                                  "           !                                JavaDoc
        !             !                               ( &               #       !
                                                                                       "Shell     !
                                              +      Shell           Java !                       (
                                            javac *.java –d <target-dir>
            <target-dir> "                                         .java     #             !
                                   #               .class    #       !     !        #               #
            #                     <target-dir> "                              !              package
                                                                     ""              #
        !                                 #                  "Java               ", #
                                                                            "java –version

            $                                     !        (batch files) !         !
                                                            "README.txt $                      '#                       " !



                                                                                                       "                %              "
                                                                                                                                       "
                                                                                       #                                           •
                                                                                                                   '        "i
                          " %+    #       &                                    &               #                    "
                                                                           "               %               #
                                                                                                           -        "
&                                                     !                                #                                    "ii
    "                                                                  &
                  !                                        !                       html*           !           #
                                                                                                           "
                                                                                "                              #            "iii
                                      #                           JavaAssignment.zip $                                             •
                                              "                            java    !                src             # "i
    "                     &                       &                    Javadoc !      !            doc              # "ii
                              "                                      "                (                                                ")
                                                          " eshcar@cs                                                                  ",




                                                                   2
                           "     #                            #   !                                                                           %
                                                          "               !               #                    &$       (


                                 !                                    (#              "        #                            #
           &   #                     '#                                                             " #                 #
          &    #                                                  #                                 !                       &        #
                " #                               !                       !                     &+                                   #            ! +
                                                      "                                   !      MVC                                     ##
                                              "                                             MVC
           !                         &                                                    ( !                               &
                                              &                                             & view*
      &        '#                    "                                                                                          database*         %
                 &                                                                        ( &                                      &      &
                                                                                                                    "
                                         # "
                   "                                                  !                         #

                                                                                                                                   Model
     !     # # "                                                              %                                     #                 #
                                                                                                                                      #
"                          ! &            &               & #         #                                                     IDataManager
                       "                                                          #                                           !
                                                 &TableModel                                                                    IDataStatus
                                         TableModel      #                                         #            "                  !
                                                  %                                                             #
               "                                              #                 #                                                   InMemoryDB
"                                                                     % DataItem                                    '#
                                                              "                                            %                        DataItem
     #    #                               %            & InMemoryDB                        %                    # * RestaurantDB
      ( &                                             #         "                                                     &Restaurant
                                                                                                       "
$                *                                      # $    (                                                                                  #
& City     & Name                              #          #                                                                     &     #
     " Price Rating                           # & Parking   & Kosher                                       & Type                   # & Street




                                                                  3
                                                                                                                                                $

Gakomati, Tel-Aviv, 27 Shaul Hamelech Av. Italian, true, free,
expensive
Moses, Tel-Aviv, 35 Rotshild Av., American, false, parking service,
expensive
Coffee Bar, Tel-Aviv, 13 Yad Charutsim, Bistro, false, evening,
moderate
Whitehall Steak House, Tel-Aviv, 6 Mendelei, Meat, false, payment
parking, expensive
Papagaio, Tel-Aviv, 14 Ha’arba’a, Meat, false, payment parking,
expensive
Jacko, Tel-Aviv, 2 Herzel, Seafood, false, payment parking, expensive
Indira, Tel-Aviv, 4 Shaul Hamelech Av., Indian, false, free, moderate
Dr Shakshuka, Jaffa, 3 Beit Eshel, Triplett, true, free, moderate

"                                       &       #                $                           #                        & !                           !
                                                                "                                                                  $
                         !                                                   "                                               AttList
                 "                                  +                         #                                    !      "       #
                 +       +                      "                                                                match
                                                                         "                                           wildcard*

                                                                                                                                               Controller
                                                            "                    #                                        !
             (                                                                                                                IDataHandler
     !                                                                   &           & #                                              "
                                            !                        !                                       "        #
                                                                                                                                                     "
                     !             "                                                                                               DataHandler
                             " #                    !                            &IDataManager                                    (        #

                                                                                                                                               View
                                                                                                 "                    #                         !
             "                  #                                                        !                        !           (#           DataView
                         IDataStatus                                (    !                                                                         %
(#       "                                                  IDataHandler                                 (
                                                        !                                    &
          "ADD                         !                                                                                                   #         #       •
     "REMOVE                            !                                            #                                                     #                 •
        "EDIT                      !                                             #                                                #                          •
      !     & #                             &                                    .       #
                                                                                                     "                        #
                                                                                             #                                                           !   •
                                   #                                     !           "MATCH                                                      !
                                                                           MatchDataView                                               &
         "           #                                                   ! &REFRESH       !                                                !                 •



                                                                             4
                !                             !       !                                   &
                                                                                          "
                                  $       +                                       !




!    % (#   "        #                            !   !   (#      MatchDataView
                    "TableModel                   (                         &
"JTable, JComboBox, JButton, JPanel, JFrame, JFileChooser

                                                                      RunApplication
                "   !                             !                         %
                                                          "main




                        ( &   (                                       !       &                 %1
                                                                  "       !           !       # #


                                      5

								
To top