Giter VIP home page Giter VIP logo

countwords's Introduction

Documentation

Problem Solutioning

Problems

Write a program called Count Words that processes a List of Strings and applies the following rules:

  1. counts and return number of words that start with M or m
  2. return all the words longer that 5 characters

Hints:

  1. Make sure you implement this test like you would all your prodcution code
  2. Business rules change and new one pop up all the time
  3. please don't input words from standard input

Solutions

1. problm 1 : Make sure you implement this test like you would all your prodcution code
solutions:
1. Create this project as maven so we can easily make this project as package and we can call this project to other project by input the artifectory version
2. Create main class to run this project so the project can run independ also
3. Create unit test to make sure there is no bug when release 
2. Business rules change and new one pop up all the time
solutions:
1. create modularity rule by encapsulated within its own WordRule class. This approach makes the code modular and easier to maintain
2. create class extenable, so if need to add new rules we just need to create new class rule without changing the old rule and the if we want to remove any rules just remove rule that we want to remove
3. please don't input words from standard input
solution:
1. create helper class to read file from path

How to Run

Run Directly to the project

1. clone this repository
2. go to the main.java
3. run main.java

Run From JAR

1. clone this repository
2. type `mvn clean pacage` on your terminal or mvn project
3. go to target file
4. run `java -jar CountWords-1.0-SNAPSHOT.jar`

Project Structure

src
│   ├── main
│   │   ├── java
            ├── Rule
            ├── RuleImpl
            ├── main.java
│   │   └── resources
│   └── test
│       ├── java
│       └── resources
├── pom.xml

Package Rule used for save all interfaces Pckage RuleImpl used for save all interface implementations

Project Dependencies

JUnit

JUnit framework is foundation for developr side testing on JVM. In this project JVM used for testing the implementation of rule to makes sure the rule works properly

Maven Plugin

A package contains Maven Plugins developed by Apache Maven Project to provide additional functionality to Maven during the build process. In this project, this package used to created JAR file.

Colaborator

@fatkhanmasruri as current github account
@fatkhanm as second account
[email protected] 
[email protected]

countwords's People

Contributors

fatkhanm avatar fatkhanmasruri avatar

Watchers

 avatar

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.