Monday, April 30, 2007

Combine Intercepting Filter and Template Method

You can use a base filter which serves as a common superclass for all filters. Common features can be encapsulated in the base filter and shared among all filters. For example, a base filter is a good place to include default behavior for the container callback methods.

At the mean time, template method can be also integrated into the base filter. As shown in this diagram.

Intercepting Filter Pattern

This pattern creates pluggable filters to process common services in a standard manner without requiring changes to core request processing code. The filters intercept incoming requests and outgoing responses, allowing preprocessing and post-processing. We are able to add and remove these filters unobtrusively, without requiring changes to our existing code.

We are able, in effect, to decorate our main processing with a variety of common services, such as security, logging, debugging, and so forth. These filters are components that are independent of the main application code, and they may be added or removed declaratively. For example, a deployment configuration file may be modified to set up a chain of filters. The same configuration file might include a mapping of specific URLs to this filter chain. When a client requests a resource that matches this configured URL mapping, the filters in the chain are each processed in order before the requested target resource is invoked.

Possible types of filters include:

  • Authentication filters
  • Logging and auditing filters
  • Image conversion filters
  • Data compression filters
  • Encryption filters
  • Tokenizing filters
  • Filters that trigger resource-access events
  • XSL/T filters that transform XML content
  • MIME-type chain filters
  • Filters that cache URLs and other information

Note: As for J2EE, filters are a new feature of the version 2.3 Java Servlet specification.

Tuesday, April 03, 2007

1998/99: A year after taking talented high school star Tracy McGrady in the draft the Raptors select his cousin Vince Carter who was a star at UNC. However, Toronto fans would have to wait to see the talented cousins in action as a 4-month lockout delayed the start of the season. When the season started the Raptors new arena was almost ready, as they beat the Vancouver Grizzlies 102-87 in their first game at the Air Canada Centre on February 21st. After years of playing in the spacious SkyDome the Raptors finally had an arena built for basketball and they clearly benefited as they finally escaped last place by posting a record of 23-27. Leading the promising Raptors was Vince Carter who became the 2nd Raptor in 4 years to win Rookie of the Year with 18.3 ppg. At season's end Carter took the microphone and addressed the ACC crowd after the final game and guaranteed a trip to the post-season next year.

1999/00: With the off-season acquisition of Antonio Davis for a high draft pick, the Raptors not only got older, they got a whole lot better. As Davis along with Charles Oakley who was acquired a year earlier provided veteran stability to a young talented team. The veteran presence helped make Vince Carter into an All-Star as he received the second most amount of all star votes ever while stealing the show in the Slam Dunk Contest which he won easily. Carter would go on to average a team high 25.7 ppg while his cousin Tracy McGrady finished second with 15.4 ppg, as the Raptors fulfilled Vince Carter's guarantee with a 45-37 record. However, in the playoffs the inexperienced Raptors would be schooled by the playoff tested New York Knicks losing in 3 straight games. Following the season, the Raptors would be jilted by Tracy McGrady, who decided to seek his own fame, out of his cousin's shadow by signing with the Orlando Magic.

2000/01: After their first playoff appearance the Raptors decided to go after a Hall of Fame coach, to lead the team to the next step as the hired al-time winingest Coach Lenny Wilkins. Vince Carter continued to establish himself as the next big star in the NBA by leading the Raptors with an impressive 27.6 pp, after exhibiting show-stopping dunks in the Olympics with Team USA. With the continued improvement of Vince Carter the Raptors would finish in 2nd place with a solid record of 47-35. In the playoffs the Raptors were matched up against the New York Knicks for the second year in a row. After splitting the first 2 games in New York the Raptors appeared to be heading for a disappointing exit again after they lost Game 3 at the ACC 97-89. However, the Raptors would send the series back to New York by winning Game 4 100-93. In the decisive 5th game in New York the Raptors would stun the Knicks 93-89 to advance to the 2nd round. In the 2nd round the Raptors were matched up against the top seed Philadelphia 76ers. However the Raptors would give the 7ers all they could handle as the battled tooth and nailed all the way to a 7th game where Vince Carter missed a buzzer beater with the Raptors down 88-87, which would have sent the Raptors on the Eastern Conference Finals.

2001/02: After experience success in the playoffs the Raptors were able to sign Vince Carter to a long-term multimillion-dollar deal to ensure their marquee stars for years to come. In addition the Raptors would add even more star power by acquiring future Hall of Famer Hakeem Olajuwon from the Houston Rockets. The Raptors appeared to be heading for another strong season as they held a record of 29-21 entering the all-star break. However, in the final game before the break Vince Carter suffered a knee injury that would hamper their star for the rest of the season. In the second half the Raptors lost 18 of 19 games including, 13 straight games following the break. With all hopes of the playoff seemingly lost Vince Carter decided to undergo knee surgery. However, the Raptors would suddenly turn thing around as they won 8 straight without Vince Carter to get back into the playoff picture. The Raptors would do on to slip into the playoff as the 7th seed with a record of 42-40. In the playoffs the Raptors would get off to a shaky start as they dropped the first 2 games on the road to the Detroit Pistons. However, coming home the Raptors would rebound nicely winning 2 games at ACC to force a decisive 5th game. In Game 5 at Detroit the Raptors gave the Pistons all they could handle before losing 85-82.

2002/03: Things looked bleak for the Raptors early in the season as Hakeem Olajuwon announced his retirement following a disappointing first season in Toronto. In addition Vince Carter continued to feel the lingering effect of his knee injury as he missed most of the first half. However, some former teammates and NBA observes began to question Carter's heart and desire and he didn't seem to be a hurry to get back in the lineup. This view was even given further ammo when Carter was dancing on stage with Nelly as the Raptors, were getting blown out by the Hawks in Atlanta. The Raptors would have all hopes for the playoff buried in January as they held a record of 8-28, which included a 12-game losing streak. Vince Carter would return and play most of the second half, averaging 20.6 ppg, but the Raptors struggles continues as Coach Lenny Wilkins who already held the record for most career wins set the record for most career losses as a coach, while the Raptors finished in 7th place with a disappointing record of 24-58. Following the final game GM Glenn Grunwald apologized to the fans at ACC announcing changes would be made. He would get started right away by firing Coach Lenny Wilkins.

2003/04: With new Coach Kevin O'Neill the Raptors started the season on a high note beating the 2-time Eastern Conference Champion New Jersey Nets 90-87. However a few days later they would set an embarrassing post shot clock record by scoring just 56 points in a loss to the Minnesota Timberwolves. That kind of inconsistency would become the hallmark of the Raptors all season, at times they looked like genuine playoff contenders, while others they looked like a last place team. At 8-8 the Raptors pulled off a blockbuster deal with the Chicago Bulls on December 1st acquiring Jalen Rose, Donyell Marshall, and Lonny Baxter in exchange for Antonio Davis, Jerome Williams, and Chris Jefferies. The Raptors would win their first 3 games after the deal but won just 1 of 7 following the initially strong start as the Raptors continued through out the entire first half as they sat at 25-25 at the All Star Break. However after the all star break injuries would become a problem as the Raptors won just 8 games the rest of the way finishing with a 33-49 record. Following the season the Raptors would fire Coach O'Neill choosing to go with Sam Mitchell.

2004/05: The Sam Mitchell era got off to a good start as the Raptors won 4 of their first 5 games. However the joy was short lived as the Raptors came back to earth fast, as a disgruntled Vince Carter continued to sulk, which hit rock bottom in a November 12th loss in Seattle as he told the Supersonics what play the team was going to run in the waning moments of an 88-87 loss. Through December the Raptors struggled badly winning just 3 of 15 games, as they finally gave up on Vince Carter as he was traded to the New Jersey Nets for Eric Williams, Aaron Williams, Alonzo Mourning, and two first-round draft picks. Mourning a future Hall of Famer refused to play for the Raptors and forced a buyout as he returned to the Miami Heat where he had his best years. Meanwhile the Raptors would go to finish tied for last place in the Atlantic Division with a 33-49 record, while Chris Bosh started to emerge as the new star of the Toronto with a solid 16.8 ppg and 8.9 rpg in just his second year.

2005/06: Under new Coach Sam Mitchell not much was expected from the Raptors who were clearly in a rebuilding mindset as they were still feeling the effects of the Vince Carter deal, in which they got nothing substantial in return, while many questioned their decision to draft Charlie Villanueva. When the season start the Raptors were struggling to match even their low expectations as they lost 15 of their first 16 games. In December the Raptors would show some improvement as they split 14 games as Chris Bosh put together an All-Star season leading the Raptors with 22.5 ppg. The Raptors would continue to play .500 ball in an up and down January that saw them set a franchise record for points in a game while a week later they were torched by Kobe Bryant for 81 points. January would also see changes in Management as GM Mike Babcock was fired and eventually replaced by Bryan Colangelo. The Raptors would close the season much as they begun losing 12 of their last 13, with Chris Bosh injured as they finished in 4th Place with a 27-55 record. The Raptors poor record would have one beneficial side effect as they won the top pick in the draft lottery which they used on Italian prodigy Andrea Bargnani, making him the first European drafted number one overall. While they would trade Charlie Villanueva, who would prove critics wrong by finishing second in Rookie of the Year Voting to the Milwaukee Bucks for play making Point Guard T.J. Ford.

猛龙队史 - 97/98

满满两年的阳光,挡不住那一夕的阴雨。

坎比等等五员大将相继倒下,被伤病浸透的猛龙无奈迎来十七连败。以色亚辞职,达蒙声言必不留营。

猛龙无奈,只好交换达蒙,虽然也换来了昌西-比卢普斯,但当时的昌西尚是菜鸟,远非今日的BIG SHOOT。

猛龙一蹶不振,16-66,全联盟垫底。

猛龙队史 - 96/97

猛龙步入第二年,以色亚-托马斯慧眼识英豪,继上一季选中最佳新秀达蒙-司徒麦尔之后,再度选中马库斯-坎比。达蒙该季的得分已经上升到了20.2分,而坎比也以场均14.7分和6.3个篮板入选了新秀挑战赛。

依然是小鬼当家,猛龙虽然战胜了诸如公牛、爵士和火箭这样的决赛圈队伍,却也输给波士顿三场。公牛是当年的总冠军,爵士和火箭则是西区的冠亚军,而波士顿一季不过才胜了15场。

第二年,30-52猛龙依然中区殿底。

猛龙队史 - 95/96

1946年11月1日,NBA的前身BAA开始了联盟的第一场球赛。

为了纪念那位加拿大人--篮球之父奈施密斯教授,第一场比赛被特意安排在多伦多开球。可惜天公不做美,多伦多HUSKIES队以66比68败给了来访的纽约尼克斯队。此后,BAA脱胎成了NBA,尼克斯也成了NBA的基石,而HUSKIES却以15-45的惨淡战绩仅生存了一个赛季便黯然收场。

光阴似箭,时光荏苒,这一去就是五十年。

九五年,正是朱罗纪公园大红大紫的那一年,顺着这股狂热,
猛龙从天而降。11月3日,也是多伦多的主场,猛龙迎战蓝网,94比78猛龙破网而出。

好彩头却依然是烂成绩,赛季结束的时候,猛龙仅仅胜了21场而排在中区最末。

虽然如此,那一季的猛龙却也是可歌可泣。一是3月24日,猛龙主场以109-108击败公牛,而那正是公牛以72-10的战绩横扫联盟的那个赛季。二是达蒙-司徒麦尔以
场均19.0分和9.3助攻当选年度最佳新秀。