Sunday, October 6, 2013

Salesforce CTA Part 2 Exam - Study Materials

A number of people have followed up with me after my earlier post on the exam about what are some of the study materials I used to prepare for the exam. To be perfectly honest, I didn't get a chance to read and review everything that I wanted to before taking the exam but I have been gathering a lot of reference material over time which I regularly reviewed and it helped when preparing for the exam. Most of them are presentations from Dreamforce '12 sessions which are available from the Salesforce Channel in YouTube and the rest are mostly articles or blogs on the developerforce.com site.

I grouped the materials into a few general areas which I think are very essential. These include (in no particular order of importance):

  • Force.com Platform
  • Platform Security
  • Integration
  • Large Data Volume Considerations
  • Single vs Multi-Org Strategy
  • Force.com Development
  • Deployment and Governance 

Again, these are just a few of the important topic areas and you should refer to the objectives in the Study Guide for the complete list.

I would highly recommend starting with this video from Dreamforce '12 which provides a good discussion around what is involved in getting the Technical Architect Certification.
http://www.youtube.com/watch?v=G2fOP7MKb6A

Force.com Platform:

The Force.com Multitenant Architecture
http://wiki.developerforce.com/page/Multi_Tenant_Architecture

Understanding Force.com Platform Internals Helps You Build Better Apps
http://blogs.developerforce.com/engineering/2013/04/understanding-force-com-platform-internals-helps-you-build-better-apps.html

Record-Level Access: Under the Hood
http://www.salesforce.com/docs/en/cce/record_access_uth/salesforce_record_access_under_the_hood.pdf

Designing Record Access for Enterprise Scale
http://www.salesforce.com/docs/en/cce/draes/draes.pdf

Platform Security:

Security Implementation Guide
http://www.salesforce.com/us/developer/docs/securityImplGuide/index.htm

A Guide to Sharing Architecture
https://na1.salesforce.com/help/doc/en/sharing_architecture.pdf

Taking a Pragmatic Look at the Salesforce Security Model

Security & Sharing Overview - You Hold the Keys
http://www.youtube.com/watch?v=UsX6mah9oKc

Managing the Role Hierarchy at Enterprise Scale
http://www.youtube.com/watch?v=FLXbt34cobg

Single Sign-On Best Practices
http://www.youtube.com/watch?v=8qTr4ulS-WU

Single Sign On with SAML
http://wiki.developerforce.com/page/Single_Sign-On_with_SAML_on_Force.com

OAuth the Big Picture
http://info.apigee.com/Portals/62317/docs/oauth_big_picture.pdf

Digging Deeper into OAuth 2.0 on Force.com
http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com

Single Sign-On for Desktop and Mobile Applications using SAML and OAuth
http://wiki.developerforce.com/page/Single_Sign-On_for_Desktop_and_Mobile_Applications_using_SAML_and_OAuth

You need to know all the OAuth and SAML flows in detail -- this is a MUST!

Integration:

Integration Wiki Page
http://wiki.developerforce.com/page/Integration

Integrating with the Force.com Platform

Large Data Volume Considerations:

Large Data Volume Deployments - Best Practices
http://www.youtube.com/watch?v=jgNlTMrox7g

Managing Large Data Volumes - Best Practices for Data Efficiency
http://www.youtube.com/watch?v=nrBqGkTBxMI

Extreme Salesforce Data Volumes
http://wiki.developerforce.com/page/Webinar:_Extreme_Salesforce_Data_Volumes_(2013-Feb)

Database Query and Search Optimization Cheat Sheet
http://s3.amazonaws.com/dfc-wiki/en/images/0/0e/Db-query-search-optimization-cheat-sheet.pdf

Best Practices for Deployments with Large Data Volumes:
http://wiki.developerforce.com/page/Best_Practices_for_Deployments_with_Large_Data_Volumes

Designing Dashboards and Reports for Force.com Implementations with Large Data Volumes
http://blogs.developerforce.com/engineering/2013/08/designing-dashboards-and-reports-for-force-com-implementations-with-large-data-volumes.html

Architect Salesforce Record Ownership Skew for Peak Performance in Large Data Volume Environments
http://blogs.developerforce.com/engineering/2012/06/architect-salesforce-record-ownership-skew-for-peak-performance-in-large-data-volume-environments.html

Reducing Lock Contention by Avoiding Account Data Skew
http://blogs.developerforce.com/engineering/2013/01/reducing-lock-contention-by-avoiding-account-data-skews.html

Working with Very Large SOQL Queries
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_VLSQ.htm

Webinar: Inside the Force.com Query Optimizer
http://wiki.developerforce.com/page/Webinar:_Inside_the_Force.com_Query_Optimizer_(2013-Apr)

Maximizing the Performance of Force.com SOQL, Reports, and List Views
http://blogs.developerforce.com/engineering/2013/07/maximizing-the-performance-of-force-com-soql-reports-and-list-views.html

Single vs Multi-Org Strategy:

Why Single Org?
- 360 degree view and reporting
- Global forecasting
- Up-sell and cross-sell
- Collaboration
- Standardize Processes
- Support

Why Multi-Org?
- Legacy
- multiple businesses acquired through acquisitions
- Independent Business Units
- business units run independently of each other
- Functional
- different business processes - hr and sales
- Legal
- tax laws, compliance
- Org Limits
- salesforce governor limits, workflow, dashboard number limits
- Geographic/Language
- different regions are autonomous (US/ EMEA)

Single or Multi-org: What's Right for My Deployment?

What is the Right Org Architecture Strategy for your Enterprise?

Thinking Differently about Orgs

Force.com Development:

Salesforce Development Lifecycle Guide
http://www.salesforce.com/us/developer/docs/dev_lifecycle/salesforce_development_lifecycle.pdf

Triggers and Order of Execution
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm

Apex Design Patterns
http://www.youtube.com/watch?v=J372XmYds-A

Applying Enterprise Application Design Patterns on Force.com
http://www.slideshare.net/afawcett/df12-applying-enterprise-application-design-patterns-on-forcecom

Deploying Salesforce Globally
http://www.slideshare.net/Salesforce/deploying-salesforce-globally

Deployment and Governance:

Continuous Delivery with Force.com
http://www.youtube.com/watch?v=xeG5SonUuA8

Release Management for Large Organizations
http://www.youtube.com/watch?v=_3YeKq00a8I

Agile Release Management in a Large Enterprise
http://www.youtube.com/watch?v=mp8mgPQNOwg

Change and Release Management: Developing A Plan That Works For You
http://www.youtube.com/watch?v=czLxAa7XkS4

Performance Monitoring and Testing the Salesforce Cloud
http://www.youtube.com/watch?v=x2Jja81xxkE

As you can tell from just looking at the titles, even if you are not planning to take the exam any time soon, reviewing these materials in detail will give you a much better insight into the force.com platform and it's capabilities. Good luck!

Implementing a Stack in Apex

Apex collections comprise of Set, List and Map types and really nothing else. If you come from a Java or .Net background this must seem quite limiting at first given the variety of collections they support. However, in a metadata driven platform such as force.com you shouldn't have to worry about the nuances of a HashMap versus a Hashtable -- you just use a Map data structure and it is automatically optimized for you by the platform. As much as I like the simplicity of the force.com Apex programming I do miss some of the collection types that I have gotten used to in Java such as TreeMap, TreeSet and Stacks which can simplify the programming quite a bit.

Recently there was a need to implement a trigger logic which although could have been done using a List, was more appropriate for the use of a Stack. So I wrote a basic Stack class and sure enough it made the rest of the implementation a lot cleaner. There are really only three basic operations for a Stack -- push() to add an item on to the stack, pop() to remove the most recent (top most) item from the stack and peek() to take a look at the top most item without removing it from the stack. We can also add a size() method to return the number of items currently in the stack and an isEmpty() method to check if the stack is empty. You could optionally implement an iterator to iterate through the Stack but that is left as an exercise for the reader (no, you can't simply expose the List iterator :).

So here is the classic Stack implemented in Apex using the List.

public class Stack {
    private List<Object> items {get; set;}
    
    public Stack() {
        this.items = new List<Object>();
    }
    
    public Integer size() {
        return this.items.size();
    }

    public Boolean isEmpty() {
        return size() == 0;
    }
        
    public void push(Object itemToPush) {
        this.items.add(itemToPush);
    }
    
    public Object pop() {
        if (isEmpty()) {
            throw new StackUnderflowException();
        }
        
        return this.items.remove(size() - 1);
    }
    
    public Object peek() {
        if (isEmpty()) {
            throw new StackUnderflowException();
        }
        
        return this.items.get(size() - 1);
    }    
}

If we try to peek or pop from an empty stack, we would get an StackUnderflowException, which is a custom exception class: 

public class StackUnderflowException extends Exception {
    /* Custom exception */
}

That's pretty much it! Now you can use it for all sorts of LIFO (Last In First Out) type functions such as evaluating expressions or parsing a syntax tree. 

Stack s = new Stack();
s.push(10.0);
s.push(5.0);
s.push('+');

while (!s.isEmpty()) {
    Object o = s.pop();

    if (String.valueOf(o) == '+') {
        Double d1 = Double.valueOf(s.pop());
        Double d2 = Double.valueOf(s.pop());
        Double result = d1 + d2;
        System.Debug(d1 + ' + ' + d2 + ' = ' + result);
    } 
}

It should print:
5.0 + 10.0 = 15.0

Happy Stacking!