The Silver Lining

Lessons & Learnings from a salesforce certified technical architect.

Archive for December 2009

Salesforce: Polymorphism driven by Apex class inheritance

with 9 comments

Polywhatsthatnow? Polymorphism ” is the ability of one type, A, to appear as and be used like another type, B.

It is a facet of OOP and can best be described using the good ol’ example of the ‘Shape’ class problem (thanks Java!). Let’s suppose we’d like to create an application that drew a number of shapes on a page. At the time of analysis we know that we want to immediately support circles, but to future-proof our application we need to support the drawing of any shapes. Being Pretty Darn Good Developers(tm) we realise we should create a Shape class that has a single method used to draw itself, and any specific shapes should be derived from this class, and override that method. Make sense? Didn’t think so. Read the rest of this entry »

Written by Wes

December 23, 2009 at 2:04 pm

A rock and a hard place

with 2 comments

We’ve all been there, and we’ll keep on returning..

Written by Wes

December 18, 2009 at 4:50 pm

Posted in SalesForce

Tagged with , , , ,

Howto: Communicate between template- and inner- pages.

with 10 comments

This post is as much about me asking a question as it is about providing a solution, so don’t let me down community. I got your back, but you’ve got to scratch mine too.. A little to the left, ah yeah, that’s it. The topics in question here are page templates, their controllers, and the pages (and the controllers) that use the template. But first let’s start with what I’ve discovered.

I like using page templates, they make my life easier. If I’m creating a site I probably want to have some consistency of navigation, page header, search etc. across all my web pages. So let’s assume I have the following setup:

1. A VisualForce page I use as a template.

2. A controller for this page that handles navigation, searching etc.

3. Several ‘inner’ VisualForce pages that use this template.

4. A controller for each of these pages. Read the rest of this entry »

Written by Wes

December 9, 2009 at 5:30 pm

Follow

Get every new post delivered to your Inbox.

Join 2,204 other followers

%d bloggers like this: