[OKC JUG] update: enum-hater and the plight of unmodular static coupling

Brett L. Schuchert schuchert at yahoo.com
Thu Dec 29 22:24:57 PST 2011


http://schuchert.wikispaces.com/JMockIt.AStoryAboutTooMuchPower

http://schuchert.wikispaces.com/Mockito.LoginServiceExample
Free tutorials:
    http://schuchert.wikispaces.com

On Dec 29, 2011, at 4:28 PM, Jay Vyas <jayunit100 at gmail.com> wrote:

> enum dude was right. just removed this enum from a code block, internalized the strings into the respective objects.
> 
> Now I can replace it with a simple Class name array, and the reflection still works fine.
> 
> 
> 
>  public static enum FBRequestType {
> 
> 
> 		USER_Extended("https://graph.facebook.com/<id>",
> 
> 				UserExtendedProfileCompletionHandler.class,
> 
> 				ChannelRequestType.FACEBOOK_USER_EXTENDED),
> 
> 
> 		USER_FRIENDS("https://graph.facebook.com/<id>/friends",
> 
> 				FriendsCompletionHandler.class,
> 
> 				ChannelRequestType.FACEBOOK_USER_FRIENDS),
> 
> 
> 		USER_NewsFeed("https://graph.facebook.com/<id>/feed",
> 
> 				NewsFeedPageCompletionHandler.class,
> 
> 				ChannelRequestType.FACEBOOK_USER_NEWSFEED),
> 
> 
> 		USER_WallFeed("https://graph.facebook.com/<id>/home",
> 
> 				WallFeedPageCompletionHandler.class,
> 
> 				ChannelRequestType.FACEBOOK_USER_WALLFEED);
> 
> 
> 		FBRequestType(String url,
> 
> 				Class<? extends AsyncCompletionHandler<Response>> handlerClass,
> 
> 				ChannelRequestType crt) {
> 
> 			this.handlerClass = handlerClass;
> 
> 			this.url = url;
> 
> 			this.chReqType = crt;
> 
> 		}
> 
> 		/**
> 
> 		 * This field should be used by any classes which need to access the
> 
> 		 * various counters produced by the crawlers. At the time of this edit,
> 		 * this includes the BatchFetchter - which assembles
> 
> 		 * "job generated properties" into a map which can be read, by
> 
> 		 * integration tests.
> 		 * 
> 
> 		 * @return
> 		 */
> 
> 		public String getCounterName() {
> 
> 			return chReqType.name();
> 
> 		};
> 
> 		public ChannelRequestType chReqType;
> 
> 		public String url;
> 
> 		public Class<? extends AsyncCompletionHandler<Response>> handlerClass;
> 
> 	}
> 
> _______________________________________________
> Jug mailing list
> Jug at lists.okcjug.org
> http://lists.okcjug.org/listinfo.cgi/jug-okcjug.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okcjug.org/pipermail/jug-okcjug.org/attachments/20111230/955a7930/attachment-0003.htm>


More information about the Jug mailing list