2012년 10월 16일
- 패턴명으로 의사소통을 하면 효율적이다.
- 역작용도 있다.
- 과도한 패턴이 쓰인 코드를 경험해서 패턴에 부정적인 팀과 일할때는 일부러 패턴명을 숨겼다는 이야기도 들었다.
- hibernate visitor 패턴. Proxy가 생성되어서 instanceof가 안 먹히기 때문에 썼지만 인터페이스를 따로 정의하면 해결할 수 있을 것 같다.
def testException | |
begin | |
File.read 'myfile' | |
rescue SystemCallError => e | |
puts 'system call failed : ' + e | |
puts e.class | |
puts "Backtrace" + e.backtrace.join("\n") | |
rescue Exceptoin => e | |
puts 'generics failure of some kind' | |
else |
package net.benelog.markerboard.presentation; | |
import java.io.IOException; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; |
from flask import Flask | |
from flask import request | |
import sys | |
app = Flask(__name__) | |
port = sys.argv[1]; | |
@app.route("/") | |
def home(): | |
msg = request.args.get('msg') |
<dependency> | |
<groupId>com.h2database</groupId> | |
<artifactId>h2</artifactId> | |
<version>1.3.166</version> | |
</dependency> |
@RequestMapping("/saveBoard") | |
public String saveBoard(@ModelAttribute @Valid Board board, BindingResult binding) { | |
if (binding.hasErrors()) { | |
return "boardInputForm"; | |
} | |
Integer seq = service.save(board); | |
return "redirect:boardDetail/" + seq; | |
} |
private Date getNowGmt() { | |
TimeZone gmt = TimeZone.getTimeZone("GMT"); | |
Calendar calendar = Calendar.getInstance(gmt); | |
return calendar.getTime(); | |
} |
package net.benelog.schedule; | |
import org.springframework.stereotype.Component; | |
@Component | |
public class SpelSchedule { | |
public void hello1() { | |
System.out.println("hello1!!!"); | |
} |
import org.junit.Test; | |
import com.carrotsearch.junitbenchmarks.AbstractBenchmark; | |
import com.carrotsearch.junitbenchmarks.BenchmarkOptions; | |
import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart; | |
/** | |
* @author benelog | |
*/ | |
@BenchmarkMethodChart(filePrefix = "benchmark-sample") |