Coder Social home page Coder Social logo

presidentsweb's Introduction

Summary

A collaborative Java web-app developed with eclipse that displays information on presidents of the United States based on user input. alt text

Instructions

  1. User arrives on landing page.
  2. User can select president based on term #, name or party.
  3. Information is displayed on chosen president.
  4. User can navigate forwards or backwards. When user gets to the end or the beginning, arrows will take them back to the other end.

Class Structure Overview

  • The PresServlet class is the controller and interacts with the PresDAOImpl class which implements methods declared in the PresDAO interface. The president object and list objects are constructed using information from the President class and accompanying .txt and .csv files.
  • The PresServlet provides information back through a .jsp file for the user to view and chooses what president's information (name, term years, picture, facts, etc.) will be displayed based upon if-logic located in the servlet that evaluates user navigation in put.

Example

@Override
	public List<President> getParty(String party) {
		List<President> presList = new ArrayList<>();
		for (President pres : presidents) {
			if (pres.getParty().equals(party)) {
				presList.add(pres);
			}
		}
		return presList;
	}

alt text

Breakdown

Sorting the Presidents by party was done by iterating the list of Presidents with the for each loop. Once the list was iterated over we used the the President's Class party variable to match the party recieved through the argument. If both parties matched then the president was stored into the presList and displayed to the user.

Reflection

This project was the first weekend project done with a team. As a collective we decided to only use one computer to push to the repository in order to avoid merge conflicts. Reflecting on our process it would have been more benificial to have run into some situations where we had to work around merge conflicts in order to get the practice on how to resolve them.

presidentsweb's People

Contributors

danrezo avatar

Watchers

James Cloos avatar

Forkers

swthomas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.