CS代写 Views and Controllers

Views and Controllers
Computer Science and Engineering  College of Engineering  The Ohio State University

Recall: Rails Architecture

Copyright By PowCoder代写 加微信 powcoder

Computer Science and Engineering  The Ohio State University

Wiring Views and Controllers
Computer Science and Engineering  The Ohio State University
 A controller is just an ordinary Ruby class  Extends ApplicationController
class CourseRosterController < ApplicationController  Location: app/controllers/  Filename: course_roster_controller.rb  Actions are methods in that class def wake_up  A view is an HTML page (kind of) that corresponds to that  Location: app/views/course_roster/  Filename: wake_up.html.erb  Has access to instance variables (e.g., @student) of corresponding controller! Recall: Rails Architecture Computer Science and Engineering  The Ohio State University app/ views/ course_roster/ wake_up.html.erb app/ controllers/ course_roster_controller.rb CourseRosterController Building From Scratch Computer Science and Engineering  The Ohio State University $ rails new demo Create CourseRosterController Location: app/controllers class CourseRosterController < ApplicationController Create (empty) method wake_up Add route to config/routes.rb get 'hi', to: 'course_roster#wake_up' Create view (wake_up.html.erb) Location: app/views/course_roster $ rails server Example: Controller Computer Science and Engineering  The Ohio State University # in app/controllers/ # filename course_roster_controller.rb class CourseRosterController < ApplicationController def wake_up # for this simple eg, no code needed Example: Route Definition Computer Science and Engineering  The Ohio State University # in config/ # filename routes.rb Rails.application.routes.draw do get 'hi', to: 'course_roster#wake_up' # equivalent to (but shorter than): # match 'hi', to: # 'course_roster#wake_up', # via: [:get] Example: View Computer Science and Engineering  The Ohio State University

Yo!!

Are you awake?

Single Point of Control
Computer Science and Engineering  The Ohio State University
Notice the duplication in names
Controller name (course_roster) used in: Name of the controller class
Filename of controller class implementation Route
Directory name containing views
Action name (wake_up) used in:
Name of the method within controller class
“Solution”: generate all these parts
$ rails g controller course_roster wake_up
Filename of view source

Generating A Controller
Computer Science and Engineering  The Ohio State University
$ rails generate controller prof
ask_question visit_office
Results in:
Addition of new routes to config/routes.rb
get ‘prof/ask_question’
Creation of ProfController class app/controllers/prof_controller.rb Definition of methods in ProfController def ask_question … end
def visit_office … end
Creation of 2 views (i.e. one per action) app/views/prof/ask_question.html.erb app/views/prof/visit_office.html.erb
$ rails server

ERb: Embedded Ruby
 General templating mechanism
Computer Science and Engineering  The Ohio State University
 “Template” = a string (usually contents of some file)
 Contains (escaped) bits of ruby
 <% code %> execute ruby code (“scriplet”)
 <%= expr %> replace with result of ruby expr  <%# text %> ignore (a comment)
 Example: a text file
This is some text.
<% 5.times do %>
Current Time is <%= Time.now %>! <% end %>
 Process using erb tool to generate result $ erb example.txt.erb > example.txt
 Naming convention: filename.outputlang.erb  Example index.html.erb
 Many alternatives, eg HAML

Example: books/index.html.erb
Computer Science and Engineering  The Ohio State University

Books

Title Summary

<% @books.each do |book| %>

<%= book.title %> <%= book.content %> <%= link_to 'Show', book %> <%= link_to 'Edit', edit_book_path(book) %> <%= link_to 'Destroy', book, method: :delete
<%= link_to 'New book', new_book_path %>
{ confirm: ‘Are you sure?’ } %>

Computer Science and Engineering  The Ohio State University
 HTML formed from: Layout + Template
 Layout is the common structure of HTML pages
 See: app/views/layouts/application.html.erb
… etc<br /> <%= yield =><br />  Action’s template replaces layout’s yield<br />  Layout is where you put site-wide styling<br />  e.g., navigation bar, div’s with CSS classes, footers</p> <p> Defining and Choosing Layouts<br /> Computer Science and Engineering  The Ohio State University<br />  Default layout for responding to action in<br /> ProfController<br />  Or controller can explicitly name layout<br /> class ProfController < ApplicationController layout "people/snazzy" # layout "people/snazzy", except: [:show]  There is an application-wide controller that can also specify a fall-back layout class ApplicationController < ActionController::Base app/views/layouts/prof.html.erb If not found, then use app/views/layouts/application.html.erb layout "main" Demo of Parameters Computer Science and Engineering  The Ohio State University Add a segment to the route get 'prof/aq/:msg', # or prof/aq/(:msg) to: 'prof#ask_question' Pass parameter to action ask_question Change ask_question to access params def ask_question @q = params[:msg] Use instance variable in view <p>You said: <%= @q %>!</p> <p> Computer Science and Engineering  The Ohio State University<br /> View/Controller coupling<br /> Layouts and templates<br /> Location of view from name of controller Filename of view from name of action Controller instance variables available<br /> Template for generating HTML Scriplets and expressions<br /> Other templating approaches exist (eg HAML)</p> <p> Recall: Rails Architecture<br /> Computer Science and Engineering  The Ohio State University<br /> app/ views/<br /> course_roster/ wake_up.html.erb<br /> app/ controllers/<br /> course_roster_controller.rb<br /> CourseRosterController</p> <p> Wiring Views and Controllers<br /> Computer Science and Engineering  The Ohio State University<br />  A controller is just an ordinary Ruby class  Extends ApplicationController<br /> class CourseRosterController < ApplicationController  Location: app/controllers/  Filename: course_roster_controller.rb  Actions are methods in that class def wake_up  A view is an HTML page (kind of) that corresponds to that action  Location: app/views/course_roster/  Filename: wake_up.html.erb  Has access to instance variables (e.g., @student) of corresponding controller! Example: books/index.html.erb Computer Science and Engineering  The Ohio State University <h1>Books</h1> <th>Title</th> <th>Summary</th> <th colspan="3"></th> <p><% @books.each do |book| %></p> <td><%= book.title %></td> <td><%= book.content %></td> <td><%= link_to 'Show', book %></td> <td><%= link_to 'Edit', edit_book_path(book) %></td> <td><%= link_to 'Destroy', book, method: :delete <br /> <%= link_to 'New book', new_book_path %><br /> { confirm: ‘Are you sure?’ } %></td> <p> Creating a Response<br /> Computer Science and Engineering  The Ohio State University<br /> There are 3 ways a controller action can<br /> create the HTTP response:<br /> 1. Do nothing: defaults are used 2. Call render method<br /> 3. Call redirect method<br /> The first 2 result in HTTP status 200 (OK) Body of response is the HTML of the view<br />  The 3rd results in HTTP status 302 (temporary redirect)<br /> Other responses are possible too (e.g., useful for ajax)</p> <p> 1: Default Response<br /> If the action does not call render (or<br /> redirect), then render is implicitly<br /> called on corresponding view<br /> class BooksController < ApplicationController @books = Book.all Results in call to render app/views/books/index.html.erb Computer Science and Engineering  The Ohio State University 2: Explicitly Calling Render Computer Science and Engineering  The Ohio State University  Argument: action whose view should be rendered def wake_up render :show # or render "show" end def show ...  Action could be from another controller Action (show) does not get executed render 'products/show'  Can return text (or json or xml) directly render plain: "OK" render json: @book # calls to_json render xml: @book # calls to_xml  Note: render does not end action, so don't call it twice ("double render" error) 3: Calling Redirect Sends response of an HTTP redirect (3xx) Default status: 302 (temporary redirect) Computer Science and Engineering  The Ohio State University Consequence: client (browser) does another request, this time to the URL indicated by the redirect response New request is a GET by default Need URL, can use named route helpers redirect_to redirect_to @user # calls redirect_to users_path redirect_to Or :back to go back in (client’s)history Override for permanent redirection (301) Redirect vs Render Similarity render... and return # force termination Difference Redirect entails 2 round-trips: request, action, response, request, action response Redirect requires a URL as argument, Render requires a view (action) Common usage for Redirect: POST-Redirect-GET pattern Computer Science and Engineering  The Ohio State University Point to a different view Neither ends the action GET Blank Form, POST the Form Computer Science and Engineering  The Ohio State University GET "a blank form" POST /students lname: ...etc GET Blank Form, POST the Form Computer Science and Engineering  The Ohio State University POST /students lname: ...etc GET Blank Form, POST the Form Computer Science and Engineering  The Ohio State University POST /students lname: ...etc GET Blank Form, POST the Form Computer Science and Engineering  The Ohio State University POST /students lname: ...etc POST-Redirect-GET Pattern Computer Science and Engineering  The Ohio State University Example of POST-Redirect-GET Computer Science and Engineering  The Ohio State University class BooksController < ApplicationController def create @book = Book.new(book_params) if @book.save redirect_to @book, notice: 'Success!' render :new Example of POST-Redirect-GET Computer Science and Engineering  The Ohio State University class BooksController < ApplicationController def create @book = Book.new(book_params) if @book.save redirect_to @book, notice: 'Success!' render :new A hash returned with redirect response Set by controller action issuing redirect flash[:referral_code] = 1234 redirect_to book_url notice: '...' redirect_to book_url alert: '...' Flash included in client’s next request Flash available to next action’s view! <p id="info"><%= flash[:warn] %>…<br /> Computer Science and Engineering  The Ohio State University<br /> Common keys can be assigned in redirect<br /> But: flash.now available to first view! flash.now[:notice] = ‘no such book’</p> <p> Flash: Set, Use, Clear<br /> Computer Science and Engineering  The Ohio State University<br /> use flash (then clear)</p> <p> Using Flash in View<br /> # display just notice message</p> <p id="notice"><%= notice %></p> <p># display all the flash messages<br /> <% if flash.any? %></p> <div id="banner"> <% flash.each do |key, message| %></p> <div class="flash <%= key %>“><br /> <%= message %><br /> Computer Science and Engineering  The Ohio State University</p> <p> Example of Render vs Redirect<br /> Computer Science and Engineering  The Ohio State University<br /> class BooksController < ApplicationController def update @book = Book.find(params[:id]) if @book.update(book_params) redirect_to @book, notice: 'Success!' render :edit Why Is This Wrong? Computer Science and Engineering  The Ohio State University class BooksController < ApplicationController def update @book = Book.find(params[:id]) if @book.update(book_params) redirect_to @book, notice: 'Success!' render :edit, notice: 'Try again.' Fix: Use Flash.now Computer Science and Engineering  The Ohio State University class BooksController < ApplicationController def update @book = Book.find(params[:id]) if @book.update(book_params) redirect_to @book, notice: 'Success!' flash.now[:notice] = 'Try again.' render :edit Your Turn: Why Is This Wrong? @books = Book.all def show # there's a mistake... @book = Book.find_by(id: params[:id]) if @book.nil? render action: "index" Computer Science and Engineering  The Ohio State University Correct, But Higher Latency @books = Book.all @book = Book.find_by(id: params[:id]) if @book.nil? redirect_to action: :index Computer Science and Engineering  The Ohio State University Better Latency, Worse Code @books = Book.all @book = Book.find_by(id: params[:id]) if @book.nil? @books = Book.all flash.now[:alert] = "Book not found" render "index" Computer Science and Engineering  The Ohio State University Code Duplication Computer Science and Engineering  The Ohio State University class BooksController < ApplicationController @book = Book.find(params[:id]) @book = Book.find(params[:id]) def update @book = Book.find(params[:id]) DRY, aka Single-Point-of-Control Computer Science and Engineering  The Ohio State University class BooksController < ApplicationController before_action :set_book, only [:show, :edit, :update, :destroy] def show # method is now empty! end def edit # method is now empty! end # and other actions... def set_book @book = Book.find(params[:id]) Sanitizing Inputs def update @book = Book.find(params[:id]) if @book.update(book_params) redirect_to @book, notice: 'Success!' render :edit def book_params params.require(:book).permit(:title, Computer Science and Engineering  The Ohio State University Recall Partials A blob of ERb used in multiple views Include in a template (or layout) with: <%= render 'menu' %><br /> <%= render 'users/icon' %><br /> Computer Science and Engineering  The Ohio State University<br /> Static header used throughout site<br /> Dynamic sidebar used in many places<br /> Filename of partial has “_” prefix Default location: app/views<br /> app/views/_menu.html.erb<br /> Organize into subdirectories with good names<br /> app/views/users/_icon.html.erb</p> <p> Example: views/layouts/applic…<br /> <!DOCTYPE html><br /> … etc <body><br /> <%= render 'layouts/header' %></p> <div class="container"> <%= yield %><br /> <%= render 'layouts/footer' %><br /> Computer Science and Engineering  The Ohio State University</p> <p> Example: views/layouts/_footer<br /> Computer Science and Engineering  The Ohio State University</p> <footer class="footer"> <a href="http://www.osu.edu">OSU</a></p> <li><%= link_to "About", about_path %></li> <li><%= link_to "Contact", </ul> </nav> <p>contact_path %></li> <p> Tricks with Partials<br /> Computer Science and Engineering  The Ohio State University<br /> Content of partial can be customized<br /> with arguments in call<br /> In call: pass a hash called :locals<br /> <%= render partial: "banner", locals: { name: "Syllabus, amount: @price } %><br /> In partial: access hash with variables</p> <h3> <%= name %> </h3> <p> Costs <%= "$#{amount}.00" %></p> <p> Parameter Passing to Partials<br /> Computer Science and Engineering  The Ohio State University<br /> Partial also has one implicit local variable<br /> In the partial, parameter name same as<br /> # in partial nav/_menu.html</p> <p> The price is: <%= menu %></p> <p> Argument value assigned explicitly<br /> <%= render partial: 'nav/menu', object: cost %><br /> Idiom: Begin partial by renaming this<br /> # in partial nav/_menu.html<br /> <% price = menu %></p> <p> Example: books/index.html.erb<br /> Computer Science and Engineering  The Ohio State University</p> <h1>Books</h1> <th>Title</th> <th>Summary</th> <th colspan="3"></th> <p><% @books.each do |book| %></p> <td><%= book.title %></td> <td><%= book.content %></td> <td><%= link_to 'Show', book %></td> <td><%= link_to 'Edit', edit_book_path(book) %></td> <td><%= link_to 'Destroy', book, method: :delete { confirm: 'Are you sure?' } %></td> <p> <%= link_to 'New book', new_book_path %></p> <p> Refactored books/index.html.erb<br /> Computer Science and Engineering  The Ohio State University</p> <h1>Books</h1> <th>Title</th> <th>Summary</th> <th colspan="3"></th> <p><% @books.each do |book| %><br /> <%= render 'detail', object: book %><br /> <br /> <%= link_to 'New book', new_book_path %></p> <p> Corresponding Partial<br /> Computer Science and Engineering  The Ohio State University</p> <td><%= detail.title %></td> <td><%= detail.content %></td> <td><%= link_to 'Show', detail %></td> <td><%= link_to 'Edit', edit_book_path(detail) %></td> <td><%= link_to 'Destroy', detail, method: :delete confirm: { 'Are you sure?' } %></td> <p> Scaffolding<br /> Generate many things at once<br /> $ rails g scaffold Student lname:string<br /> buckid:integer<br /> $ rails db:migrate<br /> $ rails server<br /> Migration for table in database Model for resource<br /> RESTful routes<br /> Controller and corresponding methods Views for responses<br /> Computer Science and Engineering  The Ohio State University</p> <p> Partials With Collections<br /> Computer Science and Engineering  The Ohio State University<br />  Iteration over partials is common <% for item in @items %><br /> <%= render partial: 'item_brief', object: item %><br />  Short-hand: Replace above with<br /> <%= render partial: 'item_brief', collection: @items %><br />  Renders partial once for each element<br />  Initializes partial local variables each time<br />  item_brief (the member of the collection)<br />  item_brief_counter (integer 0..size of collection)<br />  Can also add separator between each partial <%= render partial: 'item_brief', collection: @items, spacer_template: 'line_space' %></p> <p> Partial Super Shorthands<br /> Computer Science and Engineering  The Ohio State University<br />  For a model instance (e.g. @book) in a template <%= render @book %><br />  For a model collection (e.g. @books) in a template <%= render @books %><br />  Returns nil if collection is empty<br /> <%= render @books || 'No books to see.' %><br /> Includes _book.html.erb partial<br /> Passes in @book to partial (as :object)<br /> Value available as local variable book in partial<br /> Call render multiple times, once/member<br /> Each call uses same partial (_book.html.erb)<br /> Each call passes in different member as argument Value available as local variable book in partial</p> <p>Controller generates a response<br /> Default: render corresponding view Explicit: render some action’s view Explicit: re-direct<br /> POST-redirect-GET (aka “get after post”) Flash passes information to next action<br /> Reuse of views with partials<br /> Included with render (e.g., <%= render...) Filename is prepended with underscore Parameter passing from parent template Can iterate over partial by iterating over a collection Computer Science and Engineering  The Ohio State Univers 程序代写 <a href="https://powcoder.com/tag/代考/">CS代考</a> 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com</p> </div><!-- .entry-content .clear --> </div> </article><!-- #post-## --> <nav class="navigation post-navigation" aria-label="Post navigation"> <span class="screen-reader-text">Post navigation</span> <div class="nav-links"><div class="nav-previous"><a title="CS代考 COMP 302: Programming Languages and Paradigms" href="https://powcoder.com/2022/02/11/cs%e4%bb%a3%e8%80%83-comp-302-programming-languages-and-paradigms-3/" rel="prev"><span class="ast-left-arrow">←</span> Previous Post</a></div><div class="nav-next"><a title="CS代考 QUERYING MONGODB" href="https://powcoder.com/2022/02/11/cs%e4%bb%a3%e8%80%83-querying-mongodb/" rel="next">Next Post <span class="ast-right-arrow">→</span></a></div></div> </nav><div class="ast-single-related-posts-container ast-container--fallback"><div class="ast-related-posts-title-section"> <h2 class="ast-related-posts-title"> Related Posts </h2> </div><div class="ast-related-posts-wrapper"> <article class="ast-related-post post-38 post type-post status-publish format-standard hentry category-uncategorized tag-matlab tag-simulation"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/matlab-simulation/" target="_self" rel="bookmark noopener noreferrer">matlab simulation</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/matlab/" rel="tag">matlab代写代考</a>, <a href="https://powcoder.com/tag/simulation/" rel="tag">simulation</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-39 post type-post status-publish format-standard hentry category-uncategorized tag-c"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/ab202-assignment-1-arkapong/" target="_self" rel="bookmark noopener noreferrer">AB202 Assignment 1: Arkapong</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/c/" rel="tag">c++代做</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-40 post type-post status-publish format-standard hentry category-uncategorized tag-c"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/msc-c-programming/" target="_self" rel="bookmark noopener noreferrer">MSc C++ Programming</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/c/" rel="tag">c++代做</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-41 post type-post status-publish format-standard hentry category-uncategorized tag-prolog"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/msc-assessed-prolog-lab-exercise-2/" target="_self" rel="bookmark noopener noreferrer">MSc Assessed Prolog Lab Exercise 2</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/prolog/" rel="tag">Prolog代写代考</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-49 post type-post status-publish format-standard hentry category-uncategorized tag-c tag-uml"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/spring-session2015assignment-1/" target="_self" rel="bookmark noopener noreferrer">Spring Session:2015:Assignment 1</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/c/" rel="tag">c++代做</a>, <a href="https://powcoder.com/tag/uml/" rel="tag">UML</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-51 post type-post status-publish format-standard hentry category-uncategorized tag-uml"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/assignment-2-inception-and-elaboration/" target="_self" rel="bookmark noopener noreferrer">Assignment 2: "Inception and Elaboration"</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/uml/" rel="tag">UML</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-55 post type-post status-publish format-standard hentry category-uncategorized tag-android tag-java"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/android-app/" target="_self" rel="bookmark noopener noreferrer">android app</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/android/" rel="tag">android</a>, <a href="https://powcoder.com/tag/java/" rel="tag">Java代写代考</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-57 post type-post status-publish format-standard hentry category-uncategorized tag-java tag-junit"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/comp220-software-development-tools/" target="_self" rel="bookmark noopener noreferrer">COMP220: Software Development Tools</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/java/" rel="tag">Java代写代考</a>, <a href="https://powcoder.com/tag/junit/" rel="tag">junit</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> </div> </div> </main><!-- #main --> </div><!-- #primary --> <div class="widget-area secondary" id="secondary" itemtype="https://schema.org/WPSideBar" itemscope="itemscope"> <div class="sidebar-main" > <aside id="custom_html-2" class="widget_text widget widget_custom_html"><h2 class="widget-title">Contact</h2><div class="textwidget custom-html-widget"><ul> <li><strong>QQ: 1823890830</strong></li> <li><strong>微信号(WeChat): powcoder</strong></li> <li><img data-recalc-dims="1" class="alignnone wp-image-366" src="https://i0.wp.com/powcoder.com/wp-content/uploads/2021/01/powcoder.jpg?resize=133%2C133&ssl=1" alt="myweixin" width="133" height="133"/></li> <li><strong>Email: <a href="mailto:powcoder@163.com">powcoder@163.com</a></strong></li> </ul> <ul> <li><strong>请加微信或QQ发要求</strong></li> <li><strong>Contact me through WeChat</strong></li> </ul> </div></aside><aside id="categories-2" class="widget widget_categories"><h2 class="widget-title">Categories</h2><nav aria-label="Categories"> <ul> <li class="cat-item cat-item-245"><a href="https://powcoder.com/category/machine-learning/">机器学习代写代考 machine learning</a> </li> <li class="cat-item cat-item-242"><a href="https://powcoder.com/category/database-db-sql/">数据库代写代考 DB Database SQL</a> </li> <li class="cat-item cat-item-244"><a href="https://powcoder.com/category/data-structure-algorithm/">数据结构算法代写代考 data structure algorithm</a> </li> <li class="cat-item cat-item-239"><a href="https://powcoder.com/category/%e4%ba%ba%e5%b7%a5%e6%99%ba%e8%83%bd-ai-artificial-intelligence/">人工智能 AI Artificial Intelligence</a> </li> <li class="cat-item cat-item-247"><a href="https://powcoder.com/category/compiler/">编译器原理 Compiler</a> </li> <li class="cat-item cat-item-254"><a href="https://powcoder.com/category/network-socket/">计算机网络 套接字编程 computer network socket programming</a> </li> <li class="cat-item cat-item-240"><a href="https://powcoder.com/category/hadoop-map-reduce-spark-hbase/">大数据 Hadoop Map Reduce Spark HBase</a> </li> <li class="cat-item cat-item-241"><a href="https://powcoder.com/category/%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9fosoperating-system/">操作系统OS代写代考 (Operating System)</a> </li> <li class="cat-item cat-item-250"><a href="https://powcoder.com/category/computer-architecture/">计算机体系结构代写代考 Computer Architecture</a> </li> <li class="cat-item cat-item-251"><a href="https://powcoder.com/category/computer-graphics-opengl-webgl/">计算机图形学 Computer Graphics opengl webgl</a> </li> <li class="cat-item cat-item-249"><a href="https://powcoder.com/category/nlp/">自然语言处理 NLP natural language processing</a> </li> <li class="cat-item cat-item-383"><a href="https://powcoder.com/category/%e5%b9%b6%e8%a1%8c%e8%ae%a1%e7%ae%97/">并行计算</a> </li> <li class="cat-item cat-item-253"><a href="https://powcoder.com/category/computation-theory/">计算理论 Theory of Computation</a> </li> <li class="cat-item cat-item-252"><a href="https://powcoder.com/category/computer-security/">计算机安全密码学computer security cryptography</a> </li> <li class="cat-item cat-item-246"><a href="https://powcoder.com/category/sys-programming/">系统编程 System programming</a> </li> <li class="cat-item cat-item-367"><a href="https://powcoder.com/category/%e6%95%b0%e5%80%bc%e7%a7%91%e5%ad%a6%e8%ae%a1%e7%ae%97/">数值科学计算</a> </li> <li class="cat-item cat-item-255"><a href="https://powcoder.com/category/%e8%ae%a1%e7%ae%97%e6%9c%ba%e8%a7%86%e8%a7%89compute-vision/">计算机视觉代写代考(Compute Vision)</a> </li> <li class="cat-item cat-item-248"><a href="https://powcoder.com/category/web/">网页应用 Web Application</a> </li> <li class="cat-item cat-item-401"><a href="https://powcoder.com/category/%e5%88%86%e5%b8%83%e5%bc%8f%e7%b3%bb%e7%bb%9f/">分布式系统</a> </li> <li class="cat-item cat-item-640"><a href="https://powcoder.com/category/%e7%ac%94%e8%af%95%e9%9d%a2%e8%af%95/">笔试面试</a> </li> <li class="cat-item cat-item-403"><a href="https://powcoder.com/category/%e5%87%bd%e6%95%b0%e5%bc%8f%e7%bc%96%e7%a8%8b/">函数式编程</a> </li> <li class="cat-item cat-item-243"><a href="https://powcoder.com/category/%e6%95%b0%e6%8d%ae%e6%8c%96%e6%8e%98-data-mining/">数据挖掘 Data Mining</a> </li> <li class="cat-item cat-item-364"><a href="https://powcoder.com/category/%e7%a6%bb%e6%95%a3%e6%95%b0%e5%ad%a6/">离散数学代写代考 (Discrete mathematics)</a> </li> <li class="cat-item cat-item-384"><a href="https://powcoder.com/category/%e8%bd%af%e4%bb%b6%e5%b7%a5%e7%a8%8b/">软件工程</a> </li> <li class="cat-item cat-item-551"><a href="https://powcoder.com/category/%e7%bc%96%e7%a8%8b%e8%af%ad%e8%a8%80-programming-language/">编程语言 Programming Language</a> </li> <li class="cat-item cat-item-594"><a href="https://powcoder.com/category/%e7%bb%9f%e8%ae%a1%e4%bb%a3%e5%86%99%e4%bb%a3%e8%80%83/">统计代写代考</a> </li> <li class="cat-item cat-item-574"><a href="https://powcoder.com/category/%e8%bf%90%e7%ad%b9%e5%ad%a6-operation-research/">运筹学 Operation Research</a> </li> </ul> </nav></aside><aside id="tag_cloud-3" class="widget widget_tag_cloud"><h2 class="widget-title">Tag</h2><nav aria-label="Tag"><div class="tagcloud"><a href="https://powcoder.com/tag/algorithm/" class="tag-cloud-link tag-link-469 tag-link-position-1" style="font-size: 18px;" aria-label="Algorithm算法代写代考 (15,143 items)">Algorithm算法代写代考</a><a href="https://powcoder.com/tag/java/" class="tag-cloud-link tag-link-298 tag-link-position-2" style="font-size: 16.91156462585px;" aria-label="Java代写代考 (7,271 items)">Java代写代考</a><a href="https://powcoder.com/tag/database/" class="tag-cloud-link tag-link-414 tag-link-position-3" style="font-size: 16.503401360544px;" aria-label="database (5,442 items)">database</a><a href="https://powcoder.com/tag/data-structure/" class="tag-cloud-link tag-link-501 tag-link-position-4" style="font-size: 16.401360544218px;" aria-label="data structure (5,185 items)">data structure</a><a href="https://powcoder.com/tag/python/" class="tag-cloud-link tag-link-331 tag-link-position-5" style="font-size: 16.299319727891px;" aria-label="Python代写代考 (4,809 items)">Python代写代考</a><a href="https://powcoder.com/tag/compiler/" class="tag-cloud-link tag-link-472 tag-link-position-6" style="font-size: 16.027210884354px;" aria-label="compiler (4,000 items)">compiler</a><a href="https://powcoder.com/tag/scheme/" class="tag-cloud-link tag-link-338 tag-link-position-7" style="font-size: 15.823129251701px;" aria-label="Scheme代写代考 (3,502 items)">Scheme代写代考</a><a href="https://powcoder.com/tag/c-4/" class="tag-cloud-link tag-link-499 tag-link-position-8" style="font-size: 15.823129251701px;" aria-label="C语言代写 (3,489 items)">C语言代写</a><a href="https://powcoder.com/tag/ai/" class="tag-cloud-link tag-link-369 tag-link-position-9" style="font-size: 15.176870748299px;" aria-label="AI代写 (2,216 items)">AI代写</a><a href="https://powcoder.com/tag/c-3/" class="tag-cloud-link tag-link-491 tag-link-position-10" style="font-size: 14.700680272109px;" aria-label="c++代写 (1,633 items)">c++代写</a><a href="https://powcoder.com/tag/sql/" class="tag-cloud-link tag-link-395 tag-link-position-11" style="font-size: 14.530612244898px;" aria-label="SQL代写代考 (1,457 items)">SQL代写代考</a><a href="https://powcoder.com/tag/haskell/" class="tag-cloud-link tag-link-291 tag-link-position-12" style="font-size: 14.530612244898px;" aria-label="Haskell代写代考 (1,453 items)">Haskell代写代考</a><a href="https://powcoder.com/tag/javascript/" class="tag-cloud-link tag-link-299 tag-link-position-13" style="font-size: 14.462585034014px;" aria-label="javascript (1,395 items)">javascript</a><a href="https://powcoder.com/tag/concurrency/" class="tag-cloud-link tag-link-503 tag-link-position-14" style="font-size: 14.428571428571px;" aria-label="concurrency (1,355 items)">concurrency</a><a href="https://powcoder.com/tag/matlab/" class="tag-cloud-link tag-link-309 tag-link-position-15" style="font-size: 14.360544217687px;" aria-label="matlab代写代考 (1,281 items)">matlab代写代考</a><a href="https://powcoder.com/tag/finance/" class="tag-cloud-link tag-link-282 tag-link-position-16" style="font-size: 14.292517006803px;" aria-label="finance (1,221 items)">finance</a><a href="https://powcoder.com/tag/interpreter/" class="tag-cloud-link tag-link-297 tag-link-position-17" style="font-size: 14.190476190476px;" aria-label="interpreter (1,144 items)">interpreter</a><a href="https://powcoder.com/tag/mips/" class="tag-cloud-link tag-link-313 tag-link-position-18" style="font-size: 14.156462585034px;" aria-label="MIPS汇编代写代考 (1,134 items)">MIPS汇编代写代考</a><a href="https://powcoder.com/tag/data-mining/" class="tag-cloud-link tag-link-271 tag-link-position-19" style="font-size: 13.986394557823px;" aria-label="data mining (990 items)">data mining</a><a href="https://powcoder.com/tag/decision-tree/" class="tag-cloud-link tag-link-273 tag-link-position-20" style="font-size: 13.952380952381px;" aria-label="decision tree (982 items)">decision tree</a><a href="https://powcoder.com/tag/deep-learning/" class="tag-cloud-link tag-link-274 tag-link-position-21" style="font-size: 13.952380952381px;" aria-label="deep learning深度学习代写代考 (980 items)">deep learning深度学习代写代考</a><a href="https://powcoder.com/tag/prolog/" class="tag-cloud-link tag-link-329 tag-link-position-22" style="font-size: 13.918367346939px;" aria-label="Prolog代写代考 (957 items)">Prolog代写代考</a><a href="https://powcoder.com/tag/file-system/" class="tag-cloud-link tag-link-281 tag-link-position-23" style="font-size: 13.850340136054px;" aria-label="file system (902 items)">file system</a><a href="https://powcoder.com/tag/c/" class="tag-cloud-link tag-link-265 tag-link-position-24" style="font-size: 13.578231292517px;" aria-label="c++代做 (764 items)">c++代做</a><a href="https://powcoder.com/tag/computer-architecture/" class="tag-cloud-link tag-link-507 tag-link-position-25" style="font-size: 13.47619047619px;" aria-label="computer architecture (712 items)">computer architecture</a><a href="https://powcoder.com/tag/er/" class="tag-cloud-link tag-link-433 tag-link-position-26" style="font-size: 13.47619047619px;" aria-label="ER (711 items)">ER</a><a href="https://powcoder.com/tag/gui/" class="tag-cloud-link tag-link-290 tag-link-position-27" style="font-size: 13.47619047619px;" aria-label="gui (711 items)">gui</a><a href="https://powcoder.com/tag/gpu/" class="tag-cloud-link tag-link-396 tag-link-position-28" style="font-size: 13.272108843537px;" aria-label="GPU (620 items)">GPU</a><a href="https://powcoder.com/tag/data-science/" class="tag-cloud-link tag-link-272 tag-link-position-29" style="font-size: 13.272108843537px;" aria-label="data science (615 items)">data science</a><a href="https://powcoder.com/tag/x86%e6%b1%87%e7%bc%96/" class="tag-cloud-link tag-link-514 tag-link-position-30" style="font-size: 13.238095238095px;" aria-label="x86汇编代写代考 (606 items)">x86汇编代写代考</a><a href="https://powcoder.com/tag/case-study/" class="tag-cloud-link tag-link-468 tag-link-position-31" style="font-size: 13.204081632653px;" aria-label="case study (586 items)">case study</a><a href="https://powcoder.com/tag/distributed-system/" class="tag-cloud-link tag-link-277 tag-link-position-32" style="font-size: 13.170068027211px;" aria-label="distributed system (576 items)">distributed system</a><a href="https://powcoder.com/tag/android/" class="tag-cloud-link tag-link-256 tag-link-position-33" style="font-size: 13.034013605442px;" aria-label="android (527 items)">android</a><a href="https://powcoder.com/tag/kernel/" class="tag-cloud-link tag-link-470 tag-link-position-34" style="font-size: 13.034013605442px;" aria-label="kernel (520 items)">kernel</a><a href="https://powcoder.com/tag/arm/" class="tag-cloud-link tag-link-483 tag-link-position-35" style="font-size: 13px;" aria-label="ARM汇编代写代考 (514 items)">ARM汇编代写代考</a></div> </nav></aside><aside id="block-4" class="widget widget_block"> <div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-group__inner-container"><ul class="wp-block-latest-posts__list wp-block-latest-posts"><li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/10/12/%e7%a8%8b%e5%ba%8f%e4%bb%a3%e5%86%99-comp2521-24t3-assignment-1-2/">程序代写 COMP2521 24T3 – Assignment 1</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/10/12/%e4%bb%a3%e5%86%99%e4%bb%a3%e8%80%83-compsys-705-formal-methods-for-safety-critical-software-test-17-october-20/">代写代考 COMPSYS 705 Formal Methods for Safety Critical Software Test, 17 October 20</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/10/07/%e7%a8%8b%e5%ba%8f%e4%bb%a3%e5%86%99-comp2521-24t3-assignment-1/">程序代写 COMP2521 24T3 – Assignment 1</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/09/30/%e7%a8%8b%e5%ba%8f%e4%bb%a3%e5%86%99-comp4500-7500-2/">程序代写 COMP4500/7500</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/09/30/%e4%bb%a3%e5%86%99%e4%bb%a3%e8%80%83-comp4161-t3-2024-advanced-topics-in-software-verification/">代写代考 COMP4161 T3/2024 Advanced Topics in Software Verification</a></li> </ul></div></div> </aside> </div><!-- .sidebar-main --> </div><!-- #secondary --> </div> <!-- ast-container --> </div><!-- #content --> <footer class="site-footer" id="colophon" itemtype="https://schema.org/WPFooter" itemscope="itemscope" itemid="#colophon"> <div class="site-below-footer-wrap ast-builder-grid-row-container site-footer-focus-item ast-builder-grid-row-full ast-builder-grid-row-tablet-full ast-builder-grid-row-mobile-full ast-footer-row-stack ast-footer-row-tablet-stack ast-footer-row-mobile-stack" data-section="section-below-footer-builder"> <div class="ast-builder-grid-row-container-inner"> <div class="ast-builder-footer-grid-columns site-below-footer-inner-wrap ast-builder-grid-row"> <div class="site-footer-below-section-1 site-footer-section site-footer-section-1"> <div class="ast-builder-layout-element ast-flex site-footer-focus-item ast-footer-copyright" data-section="section-footer-builder"> <div class="ast-footer-copyright"><p>Copyright © 2024 PowCoder代写 | Powered by <a href="https://wpastra.com/" rel="nofollow noopener" target="_blank">Astra WordPress Theme</a></p> </div> </div> </div> </div> </div> </div> </footer><!-- #colophon --> </div><!-- #page --> <link rel="stylesheet" href="https://powcoder.com/wp-content/cache/minify/12163.css" media="all" /> <script id="astra-theme-js-js-extra"> var astra = {"break_point":"921","isRtl":"","is_scroll_to_id":"","is_scroll_to_top":"","is_header_footer_builder_active":"1","responsive_cart_click":"flyout"}; </script> <script src="https://powcoder.com/wp-content/cache/minify/75800.js"></script> <script src="https://stats.wp.com/e-202445.js" id="jetpack-stats-js" data-wp-strategy="defer"></script> <script id="jetpack-stats-js-after"> _stq = window._stq || []; _stq.push([ "view", JSON.parse("{\"v\":\"ext\",\"blog\":\"132118579\",\"post\":\"69387\",\"tz\":\"8\",\"srv\":\"powcoder.com\",\"j\":\"1:14.0\"}") ]); _stq.push([ "clickTrackerInit", "132118579", "69387" ]); </script> <script> /(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1); </script> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/ Object Caching 271/331 objects using Disk Page Caching using Disk: Enhanced Content Delivery Network via N/A Minified using Disk Served from: powcoder.com @ 2024-11-08 13:38:24 by W3 Total Cache -->