Skip to main content

Home/ Groups/ SoftwareEngineering
kuni katsuya

Quick Start · SpringSource/spring-social Wiki - 0 views

kuni katsuya

Chris Kelly: Programming Retrospective - 0 views

  • Programming Retrospective
  • anti-patterns
  • Final classes without interfaces
  • ...18 more annotations...
  • Lack of Defensive Programming
  • Exposure of super state to child classes
  • Printing out error messages to console instead of logging
  • Classes with unclear focus
  • Unwieldy or unneeded comments
  • Use of exceptions to control program flow
  • Throwing of ambiguous exceptions
  • Use parameter objects instead of long method signatures
  • Never Duplicate Code
  • copy and paste job
  • Return nulls from methods
  • Null Object pattern
  • onus is then on the callee to check the result is not null before using the result
  • client then doesn't have to check for nulls
  • empty map should be returned
  • instead of returning null, an
  • Refactoring: Improving the Design of Existing Code
  •  Working Effectively with Legacy Code
kuni katsuya

Emulating "self types" using Java Generics to simplify fluent API implementation | Pass... - 0 views

  • Emulating "self types" using Java Generics to simplify fluent API implementation
  • this article shows how "self types" can be emulated in Java using Generics
  • The only thing wich differs is the return type, which is always the
  • ...16 more annotations...
  • class implementing the overridden isNotNull
  • necessary because otherwise it would not be possible to add methods to a call chain which are defined in the concrete assertion class, but not in the more generic superclass where isNotNull is implemented
  • <ELEMENT_TYPE>
  • ELEMENT_TYPE actual
  • ELEMENT_TYPE actual
  • GenericAssert<ELEMENT_TYPE>
  • SELF_TYPE
  • SELF_TYPE
  • SELF_TYPE self()
  • (SELF_TYPE) this
  • SELF_TYPE isNotNull()
  •  return self();
  • SELF_TYPE extends GenericAssert<SELF_TYPE, ELEMENT_TYPE>
  • only subclasses of GenericAssert are allowed as SELF_TYPE
  • sometimes called a
  • self-bounded generic
kuni katsuya

Getting Started · UnquietCode/Flapi Wiki - 0 views

  • UnquietCode / Flapi
  • Getting Started
  • include a block chain
  • ...29 more annotations...
  • builds what is called a descriptor
  • blocks
  • methods
  • Blocks can be reused by using their name later in a addBlockReference(...) method
  • block contains methods
  • block can in turn nest other blocks
  • last()
  • Invocation Tracking
  • allowed invocations:
  • any()
  • exactly(int x)
  • atLeast(int x)
  • atMost(int x)
  • uses to build the Java code model and generate the classes and interfaces of a builder
  • between(int x, int y)
  • last(Class c)
  • Creating a Descriptor
  • Flapi.builder()
  • setPackage(String)
  • setStartingMethodName(String)
  • setDescriptorName(String)
  • setReturnType(Class)
  • enableCondensedClassNames()
  • addMethod(...)
  • startBlock(...)
  • addBlockChain(...)
  • addBlockReference(...)
  • Implementing the Helpers
  • Flapi creates only the interfaces for the helpers
kuni katsuya

UnquietCode/Flapi · GitHub - 0 views

  • UnquietCode / Flapi
  • Flapi is an API generator for Java, which generates chained API's for improved fluency in your code
  • UnquietCode / Flapi
  • ...3 more annotations...
  • Flapi is an API generator for Java, which generates chained API's for improved fluency in your code
  • code generation utility for creating fluent API in Java
  • stable release
kuni katsuya

Unquiet Code | Using Generics To Build Fluent API's In Java - 0 views

  • Using Generics To Build Fluent API's In Java
  • extends BaseClass
  • super(ChildClass.class)
  • ...19 more annotations...
  • accomplish the same idea using generics
  • creates a bad sort of dependency where we need to update the base class every time we make a new derived class. Not good!
  • superclass requests information about the child, and the child provides it
  • (CHILD)
  • <CHILD extends BakedGood<CHILD>>
  • CHILD
  • (CHILD)
  • CHILD
  • abstract
  • extends BakedGood<Cake>
  • The type parameter is saying “the Child class must extend Base<Child>”, forcing the Child class to provide its own type to the type system
  • Now that we can return the derived class in our chained method calls we are free to alternately call methods from the base class and the derived class
  • All of the normal polymorphic abilities are retained (you can see that we’ve implemented the abstract bake() method required by BakedGood)
  • .bake()
  • .bake()
  • practical applications of fluent API’s can be found
  • this one
  • best article I was able to find on the topic was
  • here and here
kuni katsuya

Chris Kelly: Using generics with a fluent API - 0 views

  • Using generics with a fluent API
  • fluent API with builders
  • fluent interface is implemented by using method chaining to relay the instruction context of a subsequent call
kuni katsuya

fernandezpablo85/scribe-java · GitHub - 0 views

  • Configuring scribe
    • kuni katsuya
       
      fluent builder-style api
kuni katsuya

agorava/agorava-core · GitHub - 0 views

  • agorava / agorava-core
  • Agorava Core
  • CDI Beans and extensions to interact with major social media (SM)
  • ...6 more annotations...
  • SN independent services like
  • OAuth connectors
  • generic Authentication and user profile
  • portable between Java EE 6
  • independent of CDI implementation
  • build on top of scribe-java
kuni katsuya

Login for Server-side Apps - Facebook Developers - 0 views

  • compare it to the same state variable stored client-side in the session
    • kuni katsuya
       
      cross-site request forgery defense mechanism
  • If the user decided to decline to authorize your app
  • YOUR_REDIRECT_URI
  • ...38 more annotations...
  • error_reason=user_denied
  • Handling Revoked Permissions to see how best to proceed
  • Step 6. Exchange the code for an Access Token
  • exchange it for a User access token that can then be used to make API requests
  • /oauth/access_token
  • server-side request to the following OAuth endpoint:
  • client_secret
  • code=CODE_GENERATED_BY_FACEBOOK
  • body of the response
  • access_token
  • USER_ACCESS_TOKEN
  • persist this User access token in your database or in a session variable
  • must have the same base domain as that specified in the App Domain property of your app's settings
  • URL of the form https://apps.facebook.com/YOUR_APP_NAMESPACE
  • scope=user_birthday,read_stream
  • Step 4. Add Permissions to Login Dialog request
  • comma-separated list of any of the Permissions available
  • Step 5. Handle the response from the Login Dialog
  • Step 5. Handle the response from the Login Dialog
  • Step 5. Handle the response from the Login Dialog
  • Step 5. Handle the response from the Login Dialog
  • YOUR_REDIRECT_URI
  • Step 3. Redirect the user to the Login Dialog
  • Login for Server-side Apps
  • Login for Server-side Apps
  • Login for Server-side Apps
  • Login for Server-side Apps
  • Login for Server-side Apps
  • Login for Server-side Apps
  • way to authenticate users in situations where the use of client-side Javascript is not appropriate.
  • Login for Server-side Apps
  • received an access token for them and can make API calls on their behalf
  • Step 5. Handle the response from the Login Dialog
  • include CSRF protection using the state parameter
  • if the user has authorized the app, they will be redirected to:
  • YOUR_REDIRECT_URI
  • code=CODE_GENERATED_BY_FACEBOOK
  • redirect_uri as the same URL that redirect the user to the Login Dialog
« First ‹ Previous 61 - 80 of 1272 Next › Last »
Showing 20 items per page