ネストされたプログラム・モデル

APIを使用してプログラミングする際、コードにネストしたプログラミング・モデルを取り入れる必要があります。ネストしたプログラミング・モデルでは、コードには初期関数と対応する最終的な関数への呼出しがあります。呼出しはサンドイッチ状に配置され、なんらかのアクションを実行するコードが中間にはさまれます。次の例を検討してください:

      begin action 1
        begin action 2
                begin action 3
                        perform action 3
                end action 3
                begin action 4
                        perform action 4
                end action 4
        end action 2
end action 1
   

この配置の実装は、開始した各アクションおよび操作を終了できるようにするものです。実際のAPIアクションを使用してより具体的な例を示します:

      Initialize the API
        Login to a server
                Connect to a database
                        Open a database outline
                                Browse the outline
                        Close the outline
                        Open a report
                                Modify & save the report
                        Close the report
                Disconnect from a database
        Logout from the server
Terminate the API
   

前述の例ではEssbase APIにアクセスする任意のコードの基本構造を示しています。