This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.eventroaster.example; | |
import org.eventroaster.annotation.Event; | |
import org.eventroaster.EventServiceFactory; | |
import org.eventroaster.annotation.EventHandler; | |
import org.eventroaster.EventService; | |
import org.eventroaster.EventServiceFactory; | |
@Event | |
public class EchoEvent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.svc; | |
import org.springframework.stereotype.Service; | |
import org.springframework.transaction.annotation.Transactional; | |
@Service("fooService") | |
@Transactional | |
final class FooServiceImpl implements FooService { | |
/* constractor, fields, etcs. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Motivation = | |
Code conventions are important to programmers for a number of reasons | |
- 80% of the lifetime cost of a piece of software goes to maintenance. | |
- Hardly any software is maintained for its whole life by the original author. | |
- Code conventions improve the software readability, allowing programmers to understand new code more quickly and thoroughly. | |
= Coding Standards = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package plugins; | |
import java.util.List; | |
import java.util.Properties; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.cloudfoundry.runtime.env.CloudEnvironment; | |
import org.cloudfoundry.runtime.env.MysqlServiceInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.strategy; | |
public interface Strategy<R> { | |
public R execute(Object input); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.factory; | |
public interface CarFactory { | |
Car createCar(); | |
} | |
public FordCarFactory implements CarFactory { | |
@Override | |
public Car createCar() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.cache; | |
import net.sf.ehcache.CacheException; | |
import net.sf.ehcache.Ehcache; | |
import net.sf.ehcache.Element; | |
import net.sf.ehcache.event.CacheEventListener; | |
final class NotNullCacheEventListener implements CacheEventListener { | |
public static final CacheEventListener INSTANCE = new NotNullCacheEventListener(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Foo { | |
Collection<Bar> getBars(); | |
Zoo getZoo(); | |
} | |
public interface Bar {} | |
public interface Zoo {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.adapter; | |
public interface ComplexNumber { | |
double real(); | |
double imaginary(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long now = System.currentTimeMillis(); | |
doSomeLongTask(); | |
long duration = System.currentTimeMillis() - now; |
OlderNewer