-
-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data transfer hash(issue 1269) #1704
Conversation
finished the design pattern data transfer hash(issue 1269)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have added the bytecode instead of the actual code.
Please submit the java code re-evaluation.
|
||
} | ||
public Object get(String k,Hash hash) | ||
{ | ||
|
||
return hash.get(k); | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the extra line spaces
|
||
} | ||
public Object get(String k,Hash hash) | ||
{ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra spaces
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why the bytecode is still here and how it managed to get inside git tracking instead of being mentioned in the gitignore 😕
-
Please take a look into these other patterns for understanding how you would like to design the readme section of the patterns from the examples below besides following the Wiki section.
- https://github.com/iluwatar/java-design-patterns/tree/master/abstract-factory
- https://github.com/iluwatar/java-design-patterns/tree/master/active-object
- https://github.com/iluwatar/java-design-patterns/tree/master/acyclic-visitor
- https://github.com/iluwatar/java-design-patterns/tree/master/acyclic-visitor
- https://github.com/iluwatar/java-design-patterns/tree/master/aggregator-microservices
- https://github.com/iluwatar/java-design-patterns/tree/master/ambassador
- https://github.com/iluwatar/java-design-patterns/tree/master/api-gateway
- https://github.com/iluwatar/java-design-patterns/tree/master/factory-method
- https://github.com/iluwatar/java-design-patterns/tree/master/flyweight
- https://github.com/iluwatar/java-design-patterns/tree/master/game-loop
- https://github.com/iluwatar/java-design-patterns/tree/master/iterator
-
Also add the pattern to the parent pom for it to get executed and perform necessary analysis on your newly submitted code.
If you have any queries or facing difficulties please reach out to me after you have read the Wiki section properly
@@ -0,0 +1,75 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Folder naming uses snake case. Data_Transfer_Hash -> data_transfer_hash
<name>Data_Transfer_Hash</name> | ||
<!-- FIXME change it to the project's website --> | ||
<url>http://www.example.com</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.7</maven.compiler.source> | ||
<maven.compiler.target>1.7</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this part
<build> | ||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> | ||
<plugins> | ||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>3.1.0</version> | ||
</plugin> | ||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.0.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.0.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-install-plugin</artifactId> | ||
<version>2.5.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>2.8.2</version> | ||
</plugin> | ||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<version>3.7.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>3.0.0</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of the plugins are already specified in the parent pom.xml. Check how the other pattern pom.xmls have been defined e.g. https://github.com/iluwatar/java-design-patterns/blob/master/abstract-factory/pom.xml
categories: Architectural | ||
tags: | ||
- Performance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest structural and decoupling. See https://github.com/iluwatar/java-design-patterns/wiki/07.-Categories-and-Tags
@@ -0,0 +1,75 @@ | |||
--- | |||
layout: pattern | |||
title: data transfer hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: data transfer hash | |
title: Data Transfer Hash | |
Business business=new Business(); | ||
Presentation presentation=new Presentation(); | ||
business.create("a", "aaa", hash); | ||
System.out.println("Business create "+"aaa"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a proper logger, check elsewhere too
/*Business objects | ||
Create hashes for sending data, or use values in received hashes.*/ | ||
public class Business { | ||
public void create(String k,Object v,Hash hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider a more descriptive name for the method
hash.create(k, v); | ||
|
||
} | ||
public Object get(String k,Hash hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider naming
private Hashtable hash; | ||
Hash() | ||
{hash=new Hashtable();} | ||
public void create(String k,Object v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would put
be a better name?
public void create(String k,Object v,Hash hash) | ||
{ | ||
hash.create(k, v); | ||
|
||
} | ||
public Object get(String k,Hash hash) | ||
{ | ||
return hash.get(k); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider naming
@x418-22n please address the review comments |
The pull request has remained inactive and is about to be closed. Please comment if you're still working on it. |
Closed due to inactivity |
finished the design pattern data transfer hash(issue 1269)