Javafx in Spring COMMUNITY クライアントでspringフレームワークを使用する理由

Total Page:16

File Type:pdf, Size:1020Kb

Javafx in Spring COMMUNITY クライアントでspringフレームワークを使用する理由 //rich client / パート1 JavaFX in Spring COMMUNITY クライアントでSpringフレームワークを使用する理由 STEPHEN CHIN avaでサーバー・サイドの開発 して、Springなどの依存性管 は、アプリケーションが大規模で複 イン・ユーザーの認証用モジュー BIO Jを行ったことがある開発者で 理フレームワークでそれらの 雑であればあるほど、得られるメリッ ル、SpringのRestTemplateを JAVA IN ACTION あれば、Javaエンタープライズ モジュールの関係をインジェク トも飛躍的に増します。 使用したバックエンドのWebサー Stephen Chin Webアプリケーションの構築や強 ション で き ま す 。 本記事では、実際のアプリ ビス統合機能、ロール別の適切な (@steveon java) 化のためにSpring Framework ■ 1行で記述できるWebサービ ケ ー ション の 中 で こうし た メリッ 権限に基づく作成/削除操作が含 オラクルの Java の何らかの要素を使用した経験 ス̶クライアントとサーバーで トを実証するために、Spring まれます。アプリケーションの最終 Technology があるのではないでしょうか。 互換性のあるRESTフレーム FrameworkとJavaFXを組み合 的な外観は図1のようになります。 Ambassador。 Spring Frameworkには、強力な ワークを利用することで、同じモ わせたアプリケーションとして、フ 全2回のシリーズを通してこの JAVA TECH JavaFX の代表的技術文 依存性注入(DI)システム、Web デル・オブジェクトを再利用し、 ロ ント エ ンド・コン ポ ー ネ ント と バッ サンプルを完成させていきます 献である Pro JavaFX 版 の モ デ ル・ビ ュ ー・コ ント ロ ー ラ データの取得、作成、削除、更新 クエンド・コンポーネントの両方 が、GitHubではすでにサンプル 2(Apress、2012 年) (MVC)フレームワーク、さらには を行うWebサービスの呼び出し を含む顧客データアプリケーショ の完全なソースコードを閲覧でき を共同執筆。Devoxx、 データベース・アクセスからセキュ を1行の文で実装できます。 ンを一から構築します。この顧客 ます。また、ダウンロードして実行 CodeMash、OSCON、 リティ認証制御までのあらゆる機 ■ 認証と認可̶クライアント上で データアプリケーションには、ログ することも可能です。 J-Fall、GeeCON、 能に対応するヘルパー・ライブラリ の認証/認可機能を一から開発 ABOUT US JAZOON、JavaOne が含まれています。 するのではなく、サーバー要求 など多くのJavaカンファ 一方、JavaFXでは2.xリリース のセキュリティ保護に使用して レンスで取り上げられ、 でPure Java APIが提供され、 いるものと同じ認証メカニズム Rock Star アワードを 2 SpringのようなJavaライブラリ を利用できます。また、詳細な 度受賞。 の統合が非常に容易になりまし 認可テストを行って、権限に応 た。Spring Frameworkをクライ じてUIの外観や操作性を変更 アント上で利用した場合、次のよ することもできます。 うなメリットがあります。 非常に単純なアプリケーション ■ UIの制御の反転̶制御の反転 の場合、これらの機能によって得ら (IoC)は、タスクの実行をその れ る メ リ ッ ト は 、新 し い ラ イ ブ ラ リ の タスクの実装から切り離すた 学習や統合にかかるコストを大き め に 用 い ら れ る オ ブ ジ ェクト 指 く上回るほどではないかもしれま blog 向の技法です。UIの場合、IoC せん。一方で、複数の画面で構成さ はスタンドアロン・モジュール れ、バックエンド・サーバーへの接続 の作成に非常に便利です。スタ やユーザーの認証を伴う大規模な ンドアロン・モジュールを作成 アプリケーションを構築する場合に 図1 35 ORACLE.COM/JAVAMAGAZINE NOVEMBER/DECEMBER 2012 //rich client / LISTING 1 アプリケーション・テンプレート 者が考慮する必要はありません。一方、 public class CustomerApp extends Application { Springを基盤としたサーバー・サイドの アプリケーション・スレッドに対しては少し COMMUNITY public static void main(String[] args) { 開発に関わったことがある方は、Spring 注意が必要です。 launch(args); を使用する新規アプリケーションの設定 JavaFXでアプリケーション・コードを } が簡単であることをご存じでしょう。JAR 呼び出す場合は、startやstopといった ファイル(またはMavenの依存関係)を アプリケーションのメソッド内であろうと @Override 追加し、web.xmlファイルにコードを数 イベント・ハンドラ内であろうと、その呼 public void start(Stage stage) throws Exception { 行追加するだけです。 び出しは必ずアプリケーション・スレッド ApplicationContext context = 一方、クライアントでは、メイン・クラス 上で実行されます。そのため、アプリケー new AnnotationConfigApplicationContext JAVA IN ACTION から手動でSpringランタイムを起動す ション側で新しいJavaFXオブジェクト CustomerAppConfiguration.class); る必要があります。本項で作成するアプ を安全に作成して、シーン・グラフを自由 ScreensConfiguration screens = context. リ ケ ー シ ョ ン・テ ン プ レ ー ト に は 、ス レ ッ ド に操作できます。ただし、アプリケーショ getBean(ScreensConfiguration.class); セーフの状態でJavaFXランタイムと ンをメイン・スレッドで実行する場合や、 screens.setPrimaryStage(stage); Springランタイムを起動する方法が示 独自のスレッドを生成する場合は、描画 screens.loginDialog().show(); されています。 ツリーに影響を及ぼすJavaFXのメソッ } その前にまずは、スレッドセーフにする ドを呼び出さないように注意してくださ } JAVA TECH 理由を理解するために、JavaFXのスレッド い。呼び出した場合は、例外やデッドロッ に関する背景情報を少し確認しましょう。 クが発生することや、さらに悪い結果に JavaFXには、目的の異なる2種類の つながることもあります。 Download all listings in this issue as text スレッドがあります。 リスト 1(CustomerModel.java) ■ アプリケーション・スレッド̶JavaFX は、CustomerAppデ モ・プ ロ ジ ェ クト のシーン・グラフに対するすべての操 の メ イ ン・ア プ リ ケ ー シ ョ ン・ク ラ ス で す 。 定義できる利便性があるだけでなく、 ンドウを使用するJavaFXオブジェクト ABOUT US 作と、トップレベル・ウィンドウを使用す JavaFXアプリケーション・スレッドの初 SpringのXMLベース設定で実現される を作成した場合は、この問題を示す例外 るオブジェクトの作成を行うスレッド。 期化や、JavaクラスからのSpring設定 強力な機能や容易なデバッグ処理もそ が発生します。一方、リスト1のstartメ Swingのイベント・ディスパッチ・スレッ のロードを行っています。 のまま活用できるためです。本記事のサ ソッドはJavaFXアプリケーション・スレッ ドに相当します(ただし、同じスレッド startメソッドの手前までは、定型的な ンプルではアノテーションベースとXML ド上で呼び出されます。そのため、任意 というわけではないため、Swingとの JavaFXアプリケーションに非常に近い ベースの設定、両方のスタイルを組み合 の型のJavaFXオブジェクトを安全に作 相互運用のためのコードでは注意して コ ード で す 。startメソッドでは、Springの わせて宣言しています。アプリケーション 成し、それらのオブジェクトをSpring設 く だ さ い )。 ApplicationContextを初期化していま の目的に応じて、こういった組み合わせ 定内からでもシーン・グラフに追加でき ■ 描画スレッド̶表示するシーンを準備 す。その際、Java設定を使用する場合は た方法も便利です。。 ます。 するために、グラフィックが変化するた 新しいAnnotationConfigApplication アプリケーションのメイン・メソッド内 リスト 1 のサンプルでは、Screens びに呼び出されるスレッド。グラフィッ Contextを作成し、XMLからロードす でSpringのコンテキストを初期化した Configurationというサブ設定クラ クの変化としては 、アニメーション/ る場合はClassPathXmlApplication くなるかもしれませんが、これは非常に スをロードし、その設定オブジェクトに CSS/レイアウトの処理、シーン・グラ Contextを作成します。 危険です。Springのコンテキストをロー stageを 設 定 し て 、ロ グ イ ン・ダ イ ア ロ blog フと描画ツリーの同期、マウス・ホバー ここでは、Spring Framework 3.0 ドした場合に、Springを起動したスレッ グ・ボックスを表示するメソッドを呼び出 の状態の更新などがあります。 で新たに導入されたアノテーションベー ドにJavaFXのオブジェクトがロードさ しています。 ほとんどの場合、描画スレッドはシー スのJava設定サポートを利用すること れる可能性があるからです。Stage、 ンのバックグラウンドで実行され、開発 を強くお勧めします。コード内で設定を Popup、Menuなどのトップレベル・ウィ 36 ORACLE.COM/JAVAMAGAZINE NOVEMBER/DECEMBER 2012 //rich client / LISTING 2a LISTING 2b DIによるUIのモジュール化 体で1つのみ存在します。 @Configuration 以上でSpringをロードできるようになり また、設定クラス全体に対して@Lazy COMMUNITY @Lazy ました。次にSpringの一部の機能を利 アノテーションを指定しています。その public class ScreensConfiguration { 用して、JavaFXアプリケーションをモ ため、それぞれのBeanは初回のアク private Stage primaryStage; ジュール化します。この顧客データアプリ セス時まで作成されません。ただし、@ ケーションは最終的に次の画面で構成さ Lazyアノテーションを指定しただけで public void setPrimaryStage(Stage primaryStage) { れます。 は、アプリケーションの起動時にBeanが this.primaryStage = primaryStage; ■ ログイン画面 作成されないことを保証するためには不 } ■ データ表示画面 十分です。複数の画面の間に直接リンク JAVA IN ACTION ■ エラー画面 がある場合は、最初の画面がロードされ public void showScreen(Parent screen) { ■ 「顧客の追加」画面 た際に、他の参照先の画面もすべて連鎖 primaryStage.setScene(new Scene(screen, 777, これらの画面は、それぞれ別個の 的 に ロ ード さ れ ま す 。 500)); JavaFXクラスまたはFXMLファイル 全画面が一度にロードされないよ primaryStage.show(); として実装します。また、他の画面の参 うにするには、リンクする画面の参照 } 照(ナビゲーションを行う場合)とモデル をインジェクションするのではなく、 (データ・アクセスやデータの更新が発 ScreensConfigurationクラスの参 @Bean JAVA TECH 生する場合)も必要になります。さらに、 照を渡します。この方法によって、別の CustomerDataScreen customerDataScreen() { 最初の利用時に画面が作成され、かつ、 ScreensConfigurationインスタンス return new CustomerDataScreen(customerDataScreen Controller()); 画面ごとに一度に1インスタンスしか保 を設定して実装を入れ替えるという柔軟 } 持しないようにします。 性を確保しながら、特定の画面をロード リスト 2 a と 2b( Screens す る メ ソ ッド が 呼 び 出 さ れ る ま で オ ブ ジ ェ @Bean Configuration.java)は、各画面をそ クトの作成を遅らせることができます。 CustomerDataScreenController customerDataScreenCon- ABOUT US れぞれ別個のBeanとして定義する モデルおよびWebサービス troller() { Spring設定クラスです。 に関するその他の設定は、別 return new CustomerDataScreenController(this); ScreensConfigurationファイルで の ク ラ ス・フ ァ イ ル に 定 義 し ま す } は、@Beanアノテーションを使用して、 (CustomerAppConfiguration. 各画面および関連コントローラを別個の java、リスト 3 参照)。このクラス @Bean Beanとして定義しています。また、一部 では、アノテーションを使用して @Scope("prototype") のBean(本記事のサンプルでは、ダイ ScreensConfigurationを ロ ードし て FXMLDialog errorDialog() { アログ・ボックスを表示するBeanのすべ います。 return new FXMLDialog(errorController(), て )を @Scope("prototype")アノテー getClass().getResource("Error.fxml"), primaryStage, ションを使用して定義しています。これ FXMLへのコントローラのインジェク StageStyle.UNDECORATED); により、インスタンスを取得しようとする ション } たびに新しいインスタンスが作成されま 前項では複数の画面を、Javaクラス・ blog す。一方、メインのデータ表示画面のス ファイルまたはFXMLとして定義しまし コープはデフォルトの" singleton"です。 た。Springによって初期化されたコン そのため、メソッドを何回呼び出したとし トローラをJavaオブジェクトに割り当 Download all listings in this issue as text ても、メイン画面はアプリケーション全 てることは非常に簡単ですが、同様の 37 ORACLE.COM/JAVAMAGAZINE NOVEMBER/DECEMBER 2012 //rich client / LISTING 3 LISTING 4 LISTING 5 LISTING 6 LISTING 7 し、その中で、パラメータとして @Configuration 渡されたコントローラを返して COMMUNITY @Import(ScreensConfiguration.class) います。 @ImportResource("classpath:applicationContext-security. このようにコントローラを作 xml") 図2 成してインジェクションするテ public class CustomerAppConfiguration { ク ニ ッ ク に よ っ て 、コ ン ト ロ ー @Bean コントローラをFXMLに割り当てること ラがSpringで管理される他のあらゆる CustomerModel customerModel() throws IOException { は、JavaFX 2.0リリースでは不可能で オブジェクトと同様に扱われます。その CustomerModel customerModel = new CustomerMod- した。しかし、JavaFX 2.1リリースで 結果、DIや「Autowiring」(自動関連付 el(); JAVA IN ACTION は、この問題を解決して各種IoCフレー け)などのフレームワークの機能を利 customerModel.setRestTemplate(restTemplate()); ムワークに対応するためのAPIが追加 用できます。ErrorControllerのソース・ customerModel.loadData(); されました。ここでの各種IoCフレーム コ ード 全 体 をリスト 6(ErrorController. return customerModel; ワークには、コンテキストと依存性の注入 java)に 示 し ま す 。ま た 、基 底 イ ン タ } (CDI)、Guiceなどのほか、言うまでも フェースのDialogControllerはリスト 7 なくSpringも含まれます。 (DialogController.java)のとおりです。 @Bean 例として 、ErrorDialogの定義を詳し 本記事のFXML UIはSceneBuilder RestTemplate restTemplate() { JAVA TECH く見てみます。ビューとコントローラは を使用して作成しました。 RestTemplate restTemplate = new RestTemplate(); 両方ともScreensConfigurationクラ SceneBuilderは、JavaFXの各種コン restTemplate.setMessageConverters Collections.<HttpMessageConverter<?>>singleton ス内で作成されます。クラスを作成する ポーネントについて学習し、UIのモック List( コ ード をリスト 4 に示します。 アップを簡 単に作 成 できる優 れたビジュ new MappingJacksonHttpMessageConverter())); errorControllerが、FXMLDialogク アル・ツールです。作成した最終的なエ return restTemplate; ラスに依存関係としてインジェクション ラ ー・ダ イ ア ロ グ・ボ ッ ク ス は 図2のように } ABOUT US されていることにお気づきでしょうか。 なります。 } FXMLDialogは、FXMLファイルのロー ド・ロ ジ ッ ク と コ ント ロ ー ラ・オ ブ ジ ェ クト まとめ のインジェクション・ロジックをまとめて 本記事では、SpringとJavaFXを組み合 カプセル化したカスタム・クラスです。 わせて使用するアプリケーションのテン FXMLDialogのソース・コード全体をリ プレートを紹介しました。このテンプレー スト 5(FXMLDialog.java)に 示 し ま す 。 トは各自のプロジェクトで再利用できま Download all listings in this issue as text FXMLDialogクラスは、FXMLファ す。Springの設定とDIを利用するだけ イルを新しいダイアログ(Stage)とし で、Pure Javaでの開発を基盤としたア てロードするために通常必要となるコー プリケーションの設計上のメリットが得ら ス な ど 、サ ン プ ル・ア プ リ ケ ー シ ョ ン の 残 ドの一部を一般化したものです。特に、 れます。 りの部分を構築します。 </article> コントローラのインジェクションにとっ パート2ではRestTemplateを使用 blog て重要な部分は、loader.setControl- して、再利用可能なモデル・オブジェクト lerFactory()の呼び出しです。この呼 を含む軽量のバックエンドや、クライアン LEARN MORE び出しにより、インナー・クラスを作成 ト側での1行で記述できるWebサービ • Stephen Chinのブログ 38 ORACLE.COM/JAVAMAGAZINE NOVEMBER/DECEMBER 2012.
Recommended publications
  • 2019 Stateof the Software Supply Chain
    2019 State of the Software Supply Chain The 5th annual report on global open source software development presented by in partnership with supported by Table of Contents Introduction................................................................................. 3 CHAPTER 4: Exemplary Dev Teams .................................26 4.1 The Enterprise Continues to Accelerate ...........................27 Infographic .................................................................................. 4 4.2 Analysis of 12,000 Large Enterprises ................................27 CHAPTER 1: Global Supply of Open Source .................5 4.3 Component Releases Make Up 85% of a Modern Application......................................... 28 1.1 Supply of Open Source is Massive ...........................................6 4.4 Characteristics of Exemplary 1.2 Supply of Open Source is Expanding Rapidly ..................7 Development Teams ................................................................... 29 1.3 Suppliers, Components and Releases ..................................7 4.5 Rewards for Exemplary Development Teams ..............34 CHAPTER 2: Global Demand for Open Source ..........8 CHAPTER 5: The Changing Landscape .......................35 2.1 Accelerating Demand for 5.1 Deming Emphasizes Building Quality In ...........................36 Open Source Libraries .....................................................................9 5.2 Tracing Vulnerable Component Release 2.2 Automated Pipelines and Downloads Across Software Supply Chains
    [Show full text]
  • Spring Framework Cookbook I
    Spring Framework Cookbook i Spring Framework Cookbook Spring Framework Cookbook ii Contents 1 Spring Framework Best Practices 1 1.1 Define singleton beans with names same as their class or interface names.....................1 1.2 Place Spring bean configuration files under a folder instead of root folder.....................1 1.3 Give common prefixes or suffixes to Spring bean configuration files........................2 1.4 Avoid using import elements within Spring XML configuration files as much as possible.............2 1.5 Stay away from auto wiring in XML based bean configurations...........................2 1.6 Always externalize bean property values with property placeholders........................3 1.7 Select default version-less XSD when importing namespace definitions.......................3 1.8 Always place classpath prefix in resource paths...................................4 1.9 Create a setter method even though you use field level auto wiring.........................4 1.10 Create a separate service layer even though service methods barely delegate their responsibilities to correspond- ing DAO methods...................................................4 1.11 Use stereotype annotations as much as possible when employing annotation driven bean configuration......5 1.12 Group handler methods according to related scenarios in different Controller beans................6 1.13 Place annotations over concrete classes and their methods instead of their interfaces................6 1.14 Prefer throwing runtime exceptions instead of checked exceptions
    [Show full text]
  • Java Web Frameworks Which One to Choose?
    Java Web Frameworks Which One to Choose? Mohamadou Nassourou Department of Computer Philology & Modern German Literature University of Würzburg Am Hubland D - 97074 Würzburg [email protected] Abstract This article discusses web frameworks that are available to a software developer in Java language. It introduces MVC paradigm and some frameworks that implement it. The article presents an overview of Struts, Spring MVC, JSF Frameworks, as well as guidelines for selecting one of them as development environment. 1. Introduction Over the last decade, the number of Java Web Frameworks has considerably increased. There are basically two types of Java Web Frameworks: component oriented frameworks and action based ones. Action frameworks are mainly focussing on request/response processing. Action frameworks are very procedural with little reusability of code/components. Component frameworks focus on object oriented web design. They do not concentrate on request/response processing. There exist several actions frameworks among them Struts and Spring MVC that I am going to present. I will introduce Java Server Faces (JSF) which is a component framework. All the frameworks that will be presented follow Model-View-Controller design pattern. 2. Model-View-Controller (MVC) Model-View-Controller design pattern helps developers to better organise their program's code. In fact it provides a way of separating user interface i.e View from the business logic i.e Model. A Controller is responsible for invoking appropriate pages according to user's request. It determines also what business logic to call for a given request. Practically JSP pages represent the view and servlets the controller.
    [Show full text]
  • A Domain Specific Graphical User Interface Framework
    Matti Panula A DOMAIN SPECIFIC GRAPHICAL USER INTERFACE FRAMEWORK Faculty of Engineering and Natural Sciences Master of Science Thesis December 2019 i ABSTRACT Matti Panula: A Domain Specific Graphical User Interface Framework Master of Science Thesis Tampere University Master’s degree Programme in Management and Information Technology December 2019 Since the early days of software development, there has been an ongoing trend towards higher- order or higher level abstractions in programming languages, software libraries and application frameworks. Some of the arguments for software development tools with higher levels of abstrac- tion include simpler software development, improved portability and better maintainability. Higher level abstractions can however lead to reduced performance. This thesis presents an innovative graphical user interface software solution that mixes high-level and low-level approaches to achieve acceptable performance while retaining good maintainability. The solution is an extension to a graphical application framework called JavaFX. The scope of this thesis is defined by a software development project which goal is to create a graphical user interface framework. The framework is used in the creation of customer specific user interfaces for an accompanying intralogistics system. The resulting user interfaces must be able to visualize possibly thousands of objects moving on a factory floor. The views must simul- taneously support user-initiated zooming, panning, and tilting of the two-dimensional view. Meet- ing these requirements while maintaining acceptable performance, requires an unconventional solution and a deviation from idiomatic JavaFX. The user interface framework in question is developed using a high-level graphical user interface application framework called JavaFX. JavaFX is the most recent graphical user interface toolkit included in the official Java Development Kit.
    [Show full text]
  • The Spring Framework: an Open Source Java Platform for Developing Robust Java Applications
    International Journal of Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278-3075, Volume-3 Issue-2, July 2013 The Spring Framework: An Open Source Java Platform for Developing Robust Java Applications Dashrath Mane, Ketaki Chitnis, Namrata Ojha Abstract— The fundamental concepts of Spring Framework is Supported deployment platforms range from standalone presented in this paper.Spring framework is an open source Java applications to Tomcat and Java EE servers such as platform that provides comprehensive infrastructure support for WebSphere. Spring is also a first-class citizen on major developing robust Java applications very easily and very rapidly. cloud platforms with Java support, e.g. on Heroku, Google The Spring Framework is a lightweight solution and a potential App Engine, Amazon Elastic Beanstalk and VMware's one-stop-shop for building your enterprise-ready applications. Cloud Foundry.[1] IndexTerms— Aspect Oriented Programming, Dependency Injection, IoC Container, ORM. II. SPRING FRAMEWORK ARCHITECTURE Spring could potentially be a one-stop shop for all your I. INTRODUCTION enterprise applications; however, Spring is modular, Spring is the most popular application development allowing you to pick and choose which modules are framework for enterprise Java. Millions of developers applicable to you, without having to bring in the rest. around the world use Spring Framework to create high The Spring Framework provides about 20 modules which performing, easily testable, reusable code. Spring can be used based on an application requirement. framework is an open source Java platform and it was initially written by Rod Johnson and was first released under the Apache 2.0 license in June 2003.
    [Show full text]
  • Spring Framework 4 on Java 8
    Spring Framework 4 on Java 8 Juergen Hoeller Spring Framework Lead Pivotal Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 1 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The State of the Art: Component Classes @Service @Lazy public class MyBookAdminService implements BookAdminService { @Autowired public MyBookAdminService(AccountRepository repo) { ... } @Transactional public BookUpdate updateBook(Addendum addendum) { ... } } Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 2 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The State of the Art: Configuration Classes @Configuration @Profile("standalone") @EnableTransactionManagement public class MyBookAdminConfig { @Bean @Scope("session") public BookAdminService myBookAdminService() { MyBookAdminService service = new MyBookAdminService(); service.setDataSource(bookAdminDataSource()); return service; } ... } Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 3 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SPRING IO CORE: Introducing Spring Framework 4.0 Unless otherwise indicated, these
    [Show full text]
  • Patterns and Frameworks
    Patterns und Frameworks für die Entwicklung paralleler und verteilter Anwendungen in Java Verfasser: Prof. Dr. Jens Ehlers, Technische Hochschule Lübeck Webseite: https://oncampus.pages.th-luebeck.de/patterns-and-frameworks GitLab: https://git.mylab.th-luebeck.de/oncampus/patterns-and-frameworks Inhaltsverzeichnis Einleitung Ziele und Struktur des Moduls Softwareprojekt als Prüfungsleistung Objektorientierung und UML-Klassendiagramm Entwurfsmuster Einführung in Entwurfsmuster Erzeugungsmuster Singleton Fabrikmethode Dependency Injection Strukturmuster Kompositum Adapter Fassade Proxy Verhaltensmuster Beobachter Strategie Architektur Modularisierung und Architektur Schichtenarchitektur Model-View-Controller MVC und MVVM in JavaFX Verteilte Programmierung Kommunikation und Skalierbarkeit im verteilten System Remote Method Invocation (RMI) SOAP-Webservices REST-Webservices Object-Relational Mapping (ORM) REST und Reactive Streams in Spring WebSockets Sockets Nebenläufige Programmierung Threads in Java Synchronisation von Threads Futures und parallele Streams UI-Frameworks Desktop-Anwendungen mit JavaFX Web-Anwendungen mit jQuery und Angular Seite 2 Ziele und Struktur des Moduls Kurzvorstellung des Moduls In dem vorliegenden Modul Patterns und Frameworks werden die erworbenen Kompetenzen aus vorherigen Modulen wie Grundlagen der Programmierung I+II, Softwaretechnik und Datenbanken zusammengeführt. Die Prüfungsleistung ist ein Softwareprojekt, dass die Studierenden i.d.R. in einem kleinen Team bearbeiten. Die Studierenden lernen bewährte Entwurfs-
    [Show full text]
  • GROOVY Name: Groovy Description: Documentation and Web Site of the Groovy Scripting Language for the JVM
    Space Details Key: GROOVY Name: Groovy Description: Documentation and web site of the Groovy scripting language for the JVM. Creator (Creation Date): bob (Apr 15, 2004) Last Modifier (Mod. Date): glaforge (Apr 12, 2005) Available Pages • Home • Advanced Usage Guide • Ant Task Troubleshooting • BuilderSupport • Compiling Groovy • Compiling With Maven2 • Design Patterns with Groovy • Abstract Factory Pattern • Adapter Pattern • Bouncer Pattern • Chain of Responsibility Pattern • Composite Pattern • Decorator Pattern • Delegation Pattern • Flyweight Pattern • Iterator Pattern • Loan my Resource Pattern • Null Object Pattern • Pimp my Library Pattern • Proxy Pattern • Singleton Pattern • State Pattern • Strategy Pattern • Template Method Pattern • Visitor Pattern • Dynamic language beans in Spring • Embedding Groovy • Influencing class loading at runtime • Make a builder • Mixed Java and Groovy Applications • Optimising Groovy bytecodes with Soot Document generated by Confluence on Sep 20, 2007 16:02 Page 1 • Refactoring with Groovy • Introduce Assertion • Replace Inheritance with Delegation • Security • Writing Domain-Specific Languages • Articles • Community and Support • Contributing • Mailing Lists • Related Projects • User Groups • Cookbook Examples • Accessing SQLServer using groovy • Alternate Spring-Groovy-Integration • Batch Image Manipulation • Compute distance from Google Earth Path (in .kml file) • Convert SQL Result To XML • Embedded Derby DB examples • Embedding a Groovy Console in a Java Server Application • Executing External
    [Show full text]
  • Getting Started with Roo
    Getting Started with Roo Getting Started with Roo Josh Long and Steve Mayzak Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo Getting Started with Roo by Josh Long and Steve Mayzak Copyright © 2011 Josh Long and Steve Mayzak. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Mike Loukides Cover Designer: Karen Montgomery Production Editor: Jasmine Perez Interior Designer: David Futato Proofreader: O’Reilly Production Services Illustrator: Robert Romano Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Getting Started with Roo, the image of the common tree kangaroo, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-1-449-30790-5 [LSI] 1312551620 Table of Contents Preface ..................................................................... vii 1. Your First Intrepid Hops … err, Steps .....................................
    [Show full text]
  • Spring Framework Lecture Notes
    Spring Framework Lecture Notes Interpersonal Barnabas glamorized acrogenously and soaringly, she connoted her reorder buccaneer mesally. Jurisprudential and prewar Ruby revitalize interlaminatewhile catenate promiscuously. Orren fumes her encrustation inconveniently and serializing unequivocally. Heather Kristos glutted that dumbness peddle mirthfully and Frankfort claims that the common scope just as some handy snippets of spring framework lecture notes quickly please refer to note To best with. In deliberate action, at udemy are objects are now when a past exam questions. One of each of mit that they give you if k is to long as maven installed using a great deal function passed to consult with. An implementation below for short time by spring lecture notes on your specific to a comprehensive tool. OS X, which be capable of providing security through their API gateway mechanisms. Note on spring framework lecture notes, lecture notes with juan gil and potentially dangerous. Receive a new java complete notes from the content with others are much else, marathon or phrase inside. This paper contains mathematical equations. Stein space had been studied since the sixties in both complex variables. Move some other libraries that spring framework is why do you need your ip. Normally this lecture notes on this course in your request completes, it around for something even more specifically marked by choosing. You want to change course policies and before will. Here for and lecture notes on spring framework with several orm, just declare it a very different kinds of your initial call a spring framework lecture notes with lots of. Carl Albing and Michael Schwarz have an an excellent power to drive everything needed to run and preserve a Java program in Linux environment including how late start, but if food could lure the divine law itself in its fume form? If we like paperback edition, JPA etc.
    [Show full text]
  • Java Web Frameworks Which One to Choose?
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Online-Publikations-Server der Universität Würzburg Java Web Frameworks Which One to Choose? Mohamadou Nassourou Department of Computer Philology & Modern German Literature University of Würzburg Am Hubland D - 97074 Würzburg [email protected] Abstract This article discusses web frameworks that are available to a software developer in Java language. It introduces MVC paradigm and some frameworks that implement it. The article presents an overview of Struts, Spring MVC, JSF Frameworks, as well as guidelines for selecting one of them as development environment. 1. Introduction Over the last decade, the number of Java Web Frameworks has considerably increased. There are basically two types of Java Web Frameworks: component oriented frameworks and action based ones. Action frameworks are mainly focussing on request/response processing. Action frameworks are very procedural with little reusability of code/components. Component frameworks focus on object oriented web design. They do not concentrate on request/response processing. There exist several actions frameworks among them Struts and Spring MVC that I am going to present. I will introduce Java Server Faces (JSF) which is a component framework. All the frameworks that will be presented follow Model-View-Controller design pattern. 2. Model-View-Controller (MVC) Model-View-Controller design pattern helps developers to better organise their program's code. In fact it provides a way of separating user interface i.e View from the business logic i.e Model. A Controller is responsible for invoking appropriate pages according to user's request.
    [Show full text]
  • Roadmap and Strategy for Weblogic / Glassfish Server in the Cloud
    Roadmap and Strategy for WebLogic / GlassFish Server in the Cloud HUJAK Keynote Duško Vukmanovi ć FMW Principal Sales Consultant Oracle Obligatory Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions . The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Program Agenda • WebLogic Server Roadmap • WebLogic Server Today / Tomorrow • GlassFish Server Roadmap • GlassFish Server Today / Tomorrow Oracle Cloud Application Foundation Complete & Integrated Modern Cloud Infrastructure Private Cloud Traffic Director/Web Tier WebLogic Coherence Tuxedo Server Deployment Public Cloud Cloud Application Foundation Roadmap WebLogic Server, Coherence and Fusion Middleware Dec 2011 Feb 2012 CY2013 CY 2013+ WebLogic Server 12c WebLogic Server 11g WebLogic Server 12c Java EE 7, Java SE 8, (12.1.1) + PS5 (10.3.6) + (12.1.2) + Cloud Coherence 3.7.1.1 Coherence 3.7.1.1 Coherence 12c (12.1.2) (12.1.3/12.1.4) • Pre-Fusion Middleware 12c • Fusion Middleware 11g PS5 • FMW Infrastructure w/ADF • SOA, ODI, WebCenter • Java EE 6 (11.1.1.6+) • Java SE 7 • Java EE 7 Reference • Java SE 6 and 7 • Java SE 6 and 7 • JDev , Eclipse, NetBeans Implementation and • Maven integration updates • JDev, OEPE, NetBeans • Upgradeability
    [Show full text]