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

learn more… | top users | synonyms

12
votes
1answer
222 views

How to best use the “Test Data Builder” pattern in a database context?

I need to setup test data in proprietary cloud platform (Salesforce.com) where I have no access to advanced testing frameworks. Besides that you can read my code example like it would be Java. ...
4
votes
2answers
88 views

Is there a visual style guide showing the default UI of visual force pages?

I am a UX designer and am relatively new to SF/VF. I would like to see the default visual styles of VF pages. Is anyone aware of a visual style guide for VF pages? I get lots of results for CSS ...
1
vote
1answer
26 views

What is the best way to structure the code in this case

Sorry for being not quite specific in the title but I find it really hard to describe the scenario in one sentence. Suppose I have two custom objects: A and B. In the triggers, trigger A calls ...
1
vote
1answer
84 views

Future call inside schedule batch

I am working on case where a scheduled batch calling a future method/class. As salesforce restricts the future call from batch , i am looking for any other alternative or workaround for this . I ...
0
votes
0answers
22 views

categorizing data of different formats with in same datatype

I am trying to achieve a strange case where i can see rows of different formats of data in an object . Eg if i select phone number field on account, i need to get view of all the records which are ...
5
votes
1answer
351 views

Will Lightning Process Builder replace Trigger dispatching logic?

I am not asking if we app developer can finally replace code with point-n-click tools. But I am asking if we will still need Trigger logic that handles modified record and dispatches them to Apex ...
7
votes
2answers
223 views

How do we deal with Trigger not referencing the actual Object?

Say I want to insert a Contact with some field, and have a Trigger that populates an other field. As a developer it always felt odd that the other field value is inaccessible without re-querying the ...
13
votes
1answer
247 views

Static Inheritance and SUPER keyword

Question about how static member/method inheritance works in apex: For reference, this question is related, but doesn't address my question or take into account my findings: reference question I ...
0
votes
2answers
36 views

Patterns or options for public application, such as a discussion forum, without heavy license costs?

Does anyone know of any development patterns or platform features/options to allow a developer to create a Force.com application, such as a discussion forum, and not have to pay for each and every ...
9
votes
3answers
497 views

Checking 'Correct' Previous value method in Trigger design best practice

One of the most common questions on this forum is around trigger recursion. There are a few standard ways to prevent recursion. My method of choice when it comes to checking for field changes, is ...
4
votes
3answers
323 views

Are trigger frameworks ALWAYS necessary?

When working on an org with a few simple requirements for triggers, I feel that using a trigger framework easily bloats the code base and a bit overkill as well. I admit this is short-sighted as ...
3
votes
0answers
102 views

How are real-world products modelled?

In Salesforce you define an object with a strongly typed set of properties and Salesforce will give you list views, details pages and create pages for free. By "reflecting" over the property types, it ...
2
votes
2answers
194 views

Salesforce design to support both Workflow field update and Trigger [duplicate]

I am having a use case where I've to do both Trigger and workflow field update. There are 2 objects. One is Case and other one is Case_child__c and Case is master and other is child. I'm having an ...
2
votes
1answer
33 views

functionality duplication design

We have developed one batch apex functionality along with some complex operations on custom object - Comp_Invest_DOC_process__c. Now user asking us to develop exact same functionality on another new ...
1
vote
1answer
559 views

Tech Spec Template [closed]

Need to create a tech spec document for a project I am working on that makes some web service calls to a VF page. I have a few templates for generic Software development Tech Spec documents, but was ...
6
votes
3answers
773 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 ...
5
votes
3answers
1k 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
508 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
139 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
259 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
481 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
354 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 ...
7
votes
2answers
1k 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 ...
8
votes
2answers
2k 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 ...
6
votes
2answers
2k 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
430 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
816 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, ...