Skip to content

Updated pull request#42

Merged
iluwatar merged 23 commits into
iluwatar:masterfrom
joshzambales:master
Apr 4, 2015
Merged

Updated pull request#42
iluwatar merged 23 commits into
iluwatar:masterfrom
joshzambales:master

Conversation

@joshzambales
Copy link
Copy Markdown
Contributor

Changelog:
-Split app into separate java files
-Added javadocs
-changed image url to point to iluwatar (UML diagram)
-changed setter injection to constructor injection
-Added intercepting-filter to pom.xml parent as a module
-configured intercepting-filter's pom.xml (my bad, careless mistake)
-separated buttons from button array and changed variable names for more consistent code

Considerations:
To make code more organized and neat, I've decided not to use anonymous classes anymore. Also, if possible, consider retention of FilterManager as I just followed the framework of my source and the delegation is how it manages the FilterChain.

@joshzambales joshzambales reopened this Apr 3, 2015
Comment thread README.md Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Remove this merge marker.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Style issue, make this final since it is initialized in constuctor

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Apr 4, 2015

Let me know when you've implemented the changes and I'll review again.

@joshzambales
Copy link
Copy Markdown
Contributor Author

I made changes according to the comments:
*Added and revised javadocs as specified
*Added access specifiers
*declared final on target as it is initialized on constructor
*replaced +- operator with String.format
*removed merge markers

Comment thread README.md
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Should be: Presentation Tier Patterns

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Apr 4, 2015

Nothing major detected, so I'm off to try to run this on my machine.

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Apr 4, 2015

Ok, there is one showstopper here. The Java source files have no package declaration (should be com.iluwatar) and they have wrong folder structure.

Put this declaration to each source file: package com.iluwatar; Then move all the source files under folder src/main/java/com/iluwatar. See the other projects for example.

Let me know when you have done this, and I'll review again.

@joshzambales
Copy link
Copy Markdown
Contributor Author

Fixed folder structure and added package :)

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Apr 4, 2015

Great! I was able to run it in Eclipse now.

iluwatar added a commit that referenced this pull request Apr 4, 2015
@iluwatar iluwatar merged commit 477d622 into iluwatar:master Apr 4, 2015
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't know if this will violate pattern structure or filters reusability, but I would like to keep related things together.
For example OrderFilter must know that it works with input array index-field "4", and FilterChain must know that value abscence for tempout[4] is "INVALID ORDER".
I see this magic (numbers and messages) go as constants either to Filter interface, or as public static final fields in each implementation.
if (tempout[OrderFilter.INDEX] == null) { return OrderFilter.ERROR_MSG; }

And one step further (although its also can have more problem with pattern consistency):
can we move INDEX and ERROR_MSG to Filter interface as methods, so we can perform polimorfic loop on list of filters instead of if-else chain?

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Apr 4, 2015

Yes, the magic numbers create an itch for me too. @vehpsr could you please work on this?

@vehpsr
Copy link
Copy Markdown
Contributor

vehpsr commented Apr 4, 2015

I certanly could, but only if @joshzambales will give up on this.
I never heard about this pattern and I never professionally worked with Desctop and Swing, so I may "lead in a wrong direction"...

Another question for me is: would I allow such/additional methods, for example, in chain-of-responsibility pattern implementation?...

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Apr 4, 2015

Yes, the Chain is certainly similar in implementation. But AFAIK they solve different problems.

There is good discussion about this here and here. Also, Intercepting Filter is well know and documented in Core J2EE Patterns.

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Apr 4, 2015

Created issue #43. @joshzambales @vehpsr let me know if you want to work on it, otherwise I will take it myself.

@iluwatar
Copy link
Copy Markdown
Owner

@all-contributors please add @joshzambales for code

@allcontributors
Copy link
Copy Markdown
Contributor

@iluwatar

I've put up a pull request to add @joshzambales! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants