Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Conversation

x418-22n
Copy link

finished the design pattern data transfer hash(issue 1269)

finished the design pattern data transfer hash(issue 1269)
@ohbus ohbus linked an issue Apr 19, 2021 that may be closed by this pull request
@ohbus ohbus self-assigned this Apr 19, 2021
Copy link
Contributor

@ohbus ohbus left a 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.

Comment on lines 8 to 16

}
public Object get(String k,Hash hash)
{

return hash.get(k);

}

Copy link
Contributor

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

Comment on lines 8 to 13

}
public Object get(String k,Hash hash)
{


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra spaces

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@ohbus ohbus left a 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 😕

  1. 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.

  2. 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"?>
Copy link
Owner

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

Comment on lines +11 to +28
<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>
Copy link
Owner

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

Comment on lines +30 to +73
<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>
Copy link
Owner

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

Comment on lines +6 to +8
categories: Architectural
tags:
- Performance
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,75 @@
---
layout: pattern
title: data transfer hash
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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");
Copy link
Owner

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)
Copy link
Owner

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)
Copy link
Owner

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)
Copy link
Owner

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?

Comment on lines +5 to +13
public void create(String k,Object v,Hash hash)
{
hash.create(k, v);

}
public Object get(String k,Hash hash)
{
return hash.get(k);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider naming

@iluwatar
Copy link
Owner

iluwatar commented Oct 9, 2021

@x418-22n please address the review comments

@iluwatar
Copy link
Owner

The pull request has remained inactive and is about to be closed. Please comment if you're still working on it.

@iluwatar iluwatar added this to the 1.26.0 milestone Jan 16, 2022
@iluwatar
Copy link
Owner

Closed due to inactivity

@iluwatar iluwatar closed this Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data Transfer Hash pattern
3 participants