Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
sfdcnihonkajinstudyevent-1-JavaVsApex
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
japanesechenmy
March 02, 2019
Technology
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
sfdcnihonkajinstudyevent-1-JavaVsApex
japanesechenmy
March 02, 2019
More Decks by japanesechenmy
See All by japanesechenmy
sfdcnihonkajinstudyevent-3-releaseOfSfdc
japanesechenmy
0
480
sfdcNihonKajinStudyEvent 1_FlowBuilder
japanesechenmy
0
250
sfdcnihonkajinstudyevent-1-releaseOfSfdc
japanesechenmy
0
320
Other Decks in Technology
See All in Technology
spanner-autoscalerに学ぶ CRD設計パターン 〜自動化と緊急時対応を両立する Kubernetesコントローラーの作り方〜
tkuchiki
0
230
自主式軟體工廠
philipz
0
140
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
320
VS Code × GitHub Copilot での Fabric 開発
ryomaru0825
1
220
HolmesGPTで始めるSREエージェント入門!プラットフォームの障害調査はAIにお任せ 〜
leveragestech
PRO
0
140
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
260
Meet AgentCore Identity Consent Portal
hironobuiga
3
180
[2026 Oracle Technical Deep Dive] AI時代のアプリケーションを支えるCloud NativeとJava EEモダナイゼーション (2026年9月17日開催)
oracle4engineer
PRO
0
110
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
170
メルカリにおけるAI時代の高速プロトタイピング基盤「Arca」
ryotarai
18
14k
LLM機能を自作して分かるSnowflake Cortex AIの強み
nayuts
0
230
Snowflake Horizon Catalog と Apache Iceberg で作る オープンなデータ基盤
kitagawaz
0
400
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
460
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
RailsConf 2023
tenderlove
30
1.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Transcript
SalesforceとJavaの異同について 郝補千
目次 1、共有内容について 2、コーディング規約 3、データ型、変数、ループの差別 4.SalesforceのDML 5.Salesforceのクラス
①、SalesforceとJavaの異同について30分間で言い切れない。 ②、 SalesforceとJavaの異同について知りたい人。 ⇒営業者 ・Javaが開発言語です。ビジネスモデルが用意しない。 ・Salesforceは、クラウド上で顧客管理・営業管理などを行うことができます。 クラウド型のため、面倒なサーバー構築などの作業は不要です。 ⇒技術者 ・Salesforceは、ソフトウェアをWeb上でサービスとして提供する「SaaS (Software
as a Service)」型のアプリケーションです。 ・SaaSの利便性をさらに高めるものとして、「PaaS(Platform as a Service)」 によるアプリケーション開発を実現させた「Force.com」があります。 1、共有内容について
③、将来的にアプリケーションの開発方向 ・Saas⇒Paas⇒Iaas SaaSとは、「Software as a Service」の頭文字を取った略語で「サース」と読みます。 PaaSは「Platform as a Service」の頭文字を取った略語で「パース」と読みます。
IaaSは「Infrastructure as a Service」の頭文字を取った略語で「イァース」と読みます。 ・PC⇒モバイル ・ビッグデータ 1、共有内容について
2、コーディング規約 Salesforceコーディング規約の構成 ◆ 基本アーキテクチャ MVC、DAO、Tigger、Object ◆ 画面規約 標準画面、Visualforce画面 ◆ オブジェクト規約
項目命名規約、項目の長さ、インデックス/外部キー、レコードタイプ ◆ コーディング命名規約 クラス名、メソッド名、引数、変数全般、ローカル変数、オブジェクト、カスタム表示ラベル ◆ プログラミング規約 使用文字規約、構文規約、空白行、コメント、例外処理規約 Salesforceコーディング適用の例 http://magnet88jp.hateblo.jp/entry/2014/07/03/143256 クラス名 ・Controllerクラス名には名前の最後に” Controller”をつける。 ・例外クラス名には名前の最後に”Exception”をつける。 ・トリガークラス名には名前の最後に” Trigger”をつける。 ・バッチクラス名には名前の最後に” Batch”をつける。
3、データ型、変数、ループの差別 項目/型一覧 カスタム項目 データ型 DisplayType Enum SOAPType Enum Primitive型 自動採番
String String String string 数式 calculated 戻り値のデータ型次第 戻り値のデータ型次第 戻り値のデータ型次第 外部参照関係 ? ? ? ? 参照関係 ID ID ID string 主従関係 ID ID ID string URL url URL String string チェックボックス boolean Boolean Boolean boolean テキスト string String String string テキスト(暗号化) encryptedstring EncryptedString String string テキストエリア textarea Textarea String string パーセント percent Percent Double double メール email Email String string テキストエリア (リッチ) textarea TextArea String string ロングテキストエリア textarea TextArea String string 数値 number Double Double double 選択リスト picklist Picklist String string 選択リスト (複数選択) multiPicklist MultiPicklist String string 地理位置情報 location Location Location ― 通貨 currency Currency String string 電話 phone Phone String string 日付 date Date Date date 日付/時間 date Datetime Datetime datetime
3、データ型、変数、ループの差別 API データ型 API データ型 データ型 ID 参照関係、主従関係 string 自動採番、メール、電話、選択リスト、複数選択リスト、テキスト、テ
キストエリア、ロングテキストエリア、テキストエリア (リッチ)、データカテゴ リグループ参照、および URL。テキスト、テキストエリア、ロングテキスト エリアでは、WSDL では最長文字数が異なります。 boolean チェックボックス double 通貨、数式、数値、パーセント、積み上げ集計 型により異なる ユーザインターフェースで数式項目を作成する場合、型を指定する必 要があります。この型は同じ名前の API データ型である currency、 date、date/time、number、percent、text に対応します。 APEXデータ型 Apexデータ型 データ型 プリミティブ Apex は、SOAP API と同じプリミティブデータ型を使用します。 Blob,Boolean,Date,Datetime,Decimal,Double,ID,,Inte ger,Long,String sObject 取引先、取引先責任者、または MyCustomObject__c など、 汎用 sObject または特定の sObject のいずれかの sObject コレクション List、Set、Map 列挙型 public enum Season {WINTER, SPRING, SUMMER, FALL} ユーザ定義の Apex クラス システムが提供する Apex ク ラス 例:database null null (任意の変数に割り当てることができる null 定数) データ型のstring/date/number/booleanはanyTypeデータ型
3、データ型、変数、ループの差別 変数 ローカル変数は、Java スタイルの構文で宣言されます。 Java と同様、複数の変数を単一のステートメントで宣言および初期設定できます。 Null 変数および初期値 変数は、宣言した後に値で初期化しないと null
になります。 Boolean b; クラス変数 変数を定義するには、次の構文を使用します。 [public | private | protected | global] [final] [static] data_type variable_name [= value] キーワード Apex は、キーワード final、instanceof、super、this、transient、with sharing、および without sharing を提供します。 Instanceof オブジェクトが実際に特定のクラスのインスタンスであることを確認するには、instanceof キーワードを使用します。 super キーワードは、仮想クラスまたは抽象クラスから拡張されるクラスで使用できます。 transient キーワードは、保存ができず、Visualforce ページのビューステートの一部として送信することもできないインスタンス変数の宣言に使用します。 inherited sharing キーワードを使用して、そのコール元のクラスの共有モードでクラスを実行します。 アノテーション @AuraEnabled @Deprecated @Future @InvocableMethod @InvocableVariable @IsTest @ReadOnly @RemoteAction @SuppressWarnings @TestSetup @TestVisible Apex REST アノテーション: @RestResource(urlMapping='/yourUrl') @HttpDelete @HttpGet @HttpPost @HttpPut
3、データ型、変数、ループの差別 Salesforceのループ Apex では、5 種類の手続き型ループをサポートしています。 ◆do {statement} while (Boolean_condition); ◆while
(Boolean_condition) statement; ◆for (initialization; Boolean_exit_condition; increment) statement; ◆for (variable : array_or_set) statement; ◆for (variable : [inline_soql_query]) statement; すべてのループは、次のループ制御構文を使用できます break; ループ全体を終了します。 continue; ループの次の反復にスキップします。 例: リスト反復またはセット反復の for ループ: for (variable : list_or_set) { code_block } SOQL for ループ: for (variable : [soql_query]) { code_block }
4.SalesforceのDML SalesforceのDML DML ステートメント次の DML ステートメントを使用できます。 ◆ insert ◆ update
◆ upsert ◆ delete ◆ undelete ◆ merge JAVAのDB操作 Javaのコードにおいて、あまり外部ライブラリに依存せずに使 うための方法として、基本としてよく出るのがJDBCというシス テムを使う方法です。 例: import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; Database クラス データを作成および操作するメソッドが含まれます。 Search クラス Search クラスのメソッドを使用して、動的な SOSL クエリを実行します。 find(searchQuery) query(query)
5.Salesforceのクラス Apexクラスの種類 ◆ Controllerクラス ⇒VF画面に関連する 標準 カスタム 拡張クラス ◆ その他クラス
⇒共通処理など。 WF用クラス Daoクラス ◆ トリガークラス ⇒DML操作に連動する。 ◆ バッチクラス ⇒日次・月次バッチ。 Apexクラスのテスト 最低限のカバー率である 75%。 トリガー、バッチクラス実行の注意事項 1トランザクションの処理レコード件数の分割 トリガー ⇒200件 バッチ ⇒最大2000件 注意1:業務上データの分割により、データ不整合。 注意2:バッチ実行時のお互いデータロック。 1 200 201 400 親レコード 子レコード
ご清聴ありがとうございました