A general reusable solution to a commonly occurring problem within a given context in software design

learn more… | top users | synonyms

4
votes
3answers
96 views

How to best structure code so it can be run synchronously and in Batch

This question is somewhat related to my other open question on the asynch/synch topic. Assume I would have an algorithm that could tell me that for a given customer org (data volumes and other ...
2
votes
2answers
88 views

Static vs Singleton

In a recent post, someone asked about implementing the Singleton Pattern in Apex, and I offered this link as a resource, and there was also this session at DF 11 that talked about the Singleton ...
1
vote
1answer
81 views

Best way to implement a singleton class in Apex

I am trying to create a singleton class for one of my apex classes and i am running into challenges. I created some static variables to control the instances but still i am running into multiple ...
0
votes
1answer
51 views

is there a business object layer in apex

We are building a custom force.com site application which uses custom objects with master detailed relationship. An example is a household which would have a collection of individuals and each ...
1
vote
1answer
83 views

“Triggers should contain no real implementation code, only callouts to utility methods”: agree or disagree? [closed]

This idea is so frequently quoted that I wonder if sometimes it is being blindly followed without much thought. Here are some points in favor of triggers containing implementation code: Keeping the ...
1
vote
1answer
67 views

Getting revised map <id, string> data back into original list under same id

I seem to be having difficulty getting data from a map back into a list so that it corresponds to the correct Id and field it was originally associated with after it's been modified in a trigger. For ...
5
votes
3answers
183 views

Controller extension design pattern help needed

Objective I'm trying to create a series of inline charts to be displayed on the detail of a record using either Visualforce Charting or Highcharts. The charts do need to be dynamically rerendered ...
6
votes
1answer
317 views

What are good design patterns for dynamic visualforce components for a data-driven input form?

I am designing a custom input form that will be data-driven and will display things like input fields, input text components, custom inputs that I create, etc. The elements on the form will be largely ...
4
votes
2answers
365 views

How to implement hashCode cleanly?

Being able to write your own equals/hashCode for a custom class seems appealing - see Non-primitive Types in Map Keys and Sets. But with no hashCode method exposed in Apex string or decimal or any of ...
5
votes
1answer
546 views

Dynamic execution of classes in Apex

How can I dynamically execute classes in Apex? What if I don't know at compile time which class should be instantiated? Rather, I would like to decide at runtime which class would be appropriate to ...
2
votes
2answers
184 views

Using the Entity–attribute–value model for sparse data

I'm looking at a design specification of a work request object that would if implemented purely as a standard salesforce object would cause very sparse columns requiring tens of recordtypes and ...
8
votes
2answers
277 views

Unit test SOQL limit setting up data model

I have run in to this situation where the data model is very complex and since SF doesn't support mocks (e.g., Mockito) there are so many SOQL executions in just setting up the data model (triggers, ...