Java ベースのアプリケーションを作成しており、その展開に Google App Engine を使用したいと考えています。しかし、このアプリケーションを、ローカルまたは他のマシン上の tomcat などの他のサーバーに移動できるようにしたいと考えています。だから私はグーグルアプリエンジンを使いたいのですが。ただし、アプリケーションを Google 固有のものから独立させたいと考えています。誰かが私が世話をしなければならない点を要約できますか. アプリケーション層とデータベース層の両方の観点から独立させたいと考えています。
2 に答える
私はあなたができると思います、そしてそれはただデザインの問題です。ほんの一例です。アプリケーションでユーザー認証が必要な場合は、インターフェースAuthenticationService
と2つの実装を作成できます。
GAEAuthenticationService
GoogleAppEngineの場合FakeAuthenticationService
桟橋で実行されているローカルテストの場合(例)DataSourceAuthenticationService
に基づく認証用DataSource
永続性、スケジューラーなどでも同じ考えを行うことができます...実行する唯一のことは次のとおりです。
必要なオブジェクトを定義し、プラットフォームに依存するさまざまな実装が必要な場合はインターフェイスを使用します
Though I am not master in google app engine however the thumb rule to make your webapp portable is to use standard specification APIs instead of vendor specific APIs. For example if your app is using google app engine UserServive (com.google.appengine.api.users.UserService) or data store com.google.appengine.api.datastore.DatastoreService , if is tightly bound with Google app engine and can not be migrated to standalone tomcat engine. To loose couple your database for further migration you should consider using MySQl schema in google app engine. Because in future you can host your database anywhere by just taking a dump. Also, you should use JDBC apis/JPA for database operations from your application using MySQL JDBC JAR
To summarize, you should avoid any API call which has com.google.appengine* import in your source. Also, you should have your own mysql schema running in google app engine cloud.