Integrating Java Projects: Eclipse IDE and GitHub Repository

Verified

Added on  2023/06/05

|6
|838
|246
Practical Assignment
AI Summary
This assignment details the process of creating a Java project in Eclipse and integrating it with a GitHub repository for version control. It outlines the steps for setting up EGit in Eclipse, creating a local repository, committing changes, and pushing updates to GitHub. The assignment also includes a TicTacToe game implementation, highlighting object-oriented programming concepts through the use of classes and objects. It demonstrates creational and behavioral design patterns, such as object instantiation and method communication, to build a functional game model. The code exhibits how different classes interact to manage the game board, player moves, and win conditions. The document includes figures showing commit changes and the GitHub repository history, offering a comprehensive guide to Java project management with Eclipse and GitHub.
Document Page
Running head: PROGRAMMING
Programming
Name of the Student:
Name of the University:
Author note:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
PROGRAMMING
Part D
In order to create a project in eclipse using the Java language and then upload them in
the respective git repository, there are several procedures available. Some might find it
comfortable to create the project in the default eclipse-workspace and then push the project
into the local repository using the Git bash from the project location. However, Eclipse has an
added plugin for this purpose that goes by the name EGit. The following steps have been
followed to commit regular project changes into the GitHub account via Eclipse:
Step 1. Open Eclipse.
Step 2. Create a new project and write the initial phase of the program.
Step 3. Help > Install New Software > Add URL https://www.eclipse.org/egit/ and
install all necessary packages.
Step 4. Right click on project folder from Eclipse’s project explorer.
Step 5. Click on Team from the menu and then Share Project.
Step 6. Open GitHub web account and create new Repository ‘PartD’.
Step 7. Configure the local repository path.
Step 8. Once the local repository is set up, right click on the project again and select
commit.
Step 9. Drag all the necessary files into the staging area, add a comment and Commit
and Push changes after inserting the repository URL from the respective GitHub
account.
Step 10. Enter and save account details and Push the updates every time it is required.
Step 11. Open the local repository and run the ‘git log’command to view the hanges in
Bash.
Document Page
2
PROGRAMMING
Fig 1. The four commit changes are listed alongside updated comments.
GitHub repository Link: https://github.com/islambeth/PartD
Fig 2. The GitHub history of the PartD repository
Document Page
3
PROGRAMMING
Part E
The TicTacToe game makes use of the object oriented programming concepts to
instantiate a command line based game. Object oriented programming is the programming
model that allows the creation and use of classes and objects to imitate real life instances.
Here, four different classes have been created in order to represent the various modules of the
program.
The creational design patterns have been highlighted through the constant creation
and uses of objects. The created player objects are either initialized with the enum value of X,
O or empty. The Grid object is also created within the main class to instantiate the game
board or the base for the game. The Grid object holds a matrix of all the boxes. This matrix of
box type will complete the structure of the entire board. It also contains the member variables
to point towards the current row and column locations. Whereas, each box class object that
constitute the grid, consists of the row and column alongside the Player object which is
associated with the particular box in the grid. As mentioned above, the GameMain class has
member variables that link the main program to the Grid and player objects directly. This
creates a clear relationship between the objects or its classes.
Behavioural design patterns are exhibited by the programs fluent use of functions or
methods. The objects are meant to use these methods to communicate with each other to
make the game to execute successfully. The play() method in the main class initializes the
game by calling the playerMove method to accept the player’s move and then it calls the grid
class’s display method to display the board instance. Other main class methods like
checkForWinner() method uses the Player object to check if it has met the winning criteria
and accordingly sets the gameOver variable to end the program. It in turn calls the Grid
class’s hasWon() method to check if the player has won or not.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
PROGRAMMING
This is how the program makes use of various design criteria to build a working
model of the game and execute it accordingly.
Document Page
5
PROGRAMMING
Bibliography
Bloch, J. (2016). Effective java. Pearson Education India.
Zakas, N. C. (2015). Object‐Oriented Programming. Professional Javascript® for Web
Developers, 173-216.
Lutz, M. (2013). Learning Python: Powerful Object-Oriented Programming. " O'Reilly
Media, Inc.".
Dabbish, L., Stuart, C., Tsay, J., & Herbsleb, J. (2012, February). Social coding in GitHub:
transparency and collaboration in an open software repository. In Proceedings of the
ACM 2012 conference on computer supported cooperative work (pp. 1277-1286).
ACM.
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]