More on the Spring ‘07 event
I’ve just found a great writeup of the event Salesforce Spring ‘07 event over on Where’s the Upside?. Mine are here, here and here.
Technorati Tags: salesforce
Apex Code for Beginners at the Salesforce.com Spring ‘07 release
The final session that I attended at the launch was Apex Code for Beginners, delivered by Adam Gross. It was a great talk, providing some nice slices of Apex Code to whet your appetite.
Adam sees the Apex Platform as based on five pillars:
- Data & Native Framework – the full-stack on-demand framework for creating apps. (I think I can see why they call it a “native framework” but that name just confuses me.)
- The API – that’s actually the Web services API they refer to when they say “API” It’s now running at over 50% of the traffic, though from what I read that may go down if folk started using the relationship queries that were recently introduced.
- Packaging and Distribution – does what it says on the tin
- Apex Code – their multi-tenant programming language
- Composite Framework – another interesting name. I think what they mean here is Extensibility/Integration Framework
Adam was really keen that folk starting using all the new features, including Apex Code. Of course, you can’t use them in production yet – but they’re there now for us to provide some feedback and hopefully drive the future direction. Starting to use them now will also give us a little advantage when the rest of the world realizes how important they are ;-)
So, Apex Code. This language is exclusively for business logic. I like the analogy Adam made. ‘”Conceptually” it’s similar to a stored procedure’ – that’s the analogy I had in my head when I started using Apex Code. The important thing to remember is that it’s not a general purpose programming language – you can’t go and write a UI. It’s specifically designed for data manipulation and business logic.
A little example (not quite what Adam used – this is from a whitepaper on ADN):
01. // Define a trigger for the Lead object, and set it to
02. // fire on the insert and update events
03. trigger leadDupCheck on Lead(before insert, before update) {
04. // Make sure the email and zip code fields aren’t null
05. if (Trigger.new.Email != null &&
Trigger.new.PostalCode != null ) {
06. // Query for all leads that have the same email and zip code
07. // as the new lead
08. Integer dupCount =
09. [select count() from Lead WHERE email = :Trigger.new.Email
10. AND PostalCode = :Trigger.new.PostalCode ];
11. if ( dupCount > 0 ) {
12. // Lead exists, so display an error message
13. Trigger.new.email.addError('Lead is a duplicate');
14. } else {
15. // No dup is found, so let the processing continue
16. }
17. }
18. }
I think it’s pretty readable, but here are some notes:
- This code triggers before a Lead object is inserted or updated. See Line 03. Note that the code will run irrespective of how the Lead object is inserted or updated. For example, through the web services API or through the UI.
- Line 05 accesses
Trigger.new.Email– this actually refers to the Email field in the incoming Trigger object, in this case the Lead object being created/updated. So in effect your trigger code has full access to the object during the period after someone started its “creation” but before it’s been “persisted” – this is awesome of course, and opens up a number of opportunities. - Check out the embedded, inlined SOQL query on line 9. It automatically grabs the Email and PostalCode fields from the incoming Lead object too. Neat.
Other Apex features Adam noted: strongly typed, fine grained event model (insert, update, delete), transaction control, native web services production, App Exchange friendly (packageable and redistributable). Also, the code is governed. Because it’s multi-tennant, you don’t really want one client running code that slows down other clients, so they’ve added some governors. In essence, it sounds like the runtime observes the execution, tallies up some things, and if they exceed some limits throws an exception instead of letting your code hog the machine. Some of the possible constraints Adam mentioned were: total number of SOQL statements executed, total number of rows retrieved, data modifications and transactions. I’d be interested to see how these governors work in the case of a bulk input for example.
A question that popped into my mind is “how do I test this.” I’d really like a way of setting up test cases, test data and execution runs of my triggers :-)
Adam also pointed to the Eclipse Toolkit (in fact, he used it) for remove validation/compilation (neat). He also mentioned something about “AppLab” – training for Apex Code in London happening April 16. Unfortunately I can’t find any details on the developer site yet – so if anyone from Salesforce is reading, please leave a comment!
All in all this was a great session where I learned a lot. I expect a lot more developers will start to use Apex Code once they realize how powerful it is—and how it provides features not otherwise available.
Adam spoke about how they were looking for feedback, so in that spirit:
I find the Apex Code syntax a little weird in a couple of places, which may throw a lot of folk new to the language:
- They use things that look remarkably like arguments, to carry metadata instead. Ack! So the “arguments” on Line 3 aren’t actually arguments to the trigger, but rather they’re metadata denoting when the trigger should be run.
- I wish they let me name the incoming parameter, the actual trigger object. Right now it’s just “Trigger”
- Metadata is hot. Everyone is using it. Check out EJB 3 for the beauty of metadata. Once Apex Code takes off they’re going to want to introduce even more metadata. How about following Java’s lead on this and use something extensible?
Putting all of this together, I get:
/*
* @Trigger.beforeUpdate
* @Trigger.beforeInsert
*/
trigger leadDupCheck (Lead incoming) {
if (incoming.Email != null) ...
}
Technorati Tags: apex, salesforce
More news from Salesforce.com Spring ‘07: AppSpace
Next up during the keynote is/was George Hu, Chief Marketing Officer, talking about the Spring ‘07 release. This is the 22nd release – perpetual beta indeed. Lots of customer participation too – everything from the logo to features in the new release – much of which is surfaced in IdeaExchange. Though I haven’t heard “web 2.0″ uttered yet, it feels like these guys are embracing it.
George gave a little demonstration – some features that jumped out:
- popup reminders (apparently customers want these!)
- Ajax (?) rollovers with additional information.
- Enhanced search (it’s what most folk do when they log in) – lots of sexy on-page Ajax refresh when sorting/finding data.
- Embedded mashups
- Locked records for approval workflows with audit trails etc. They can even approve via email etc. Which means Salesforce accepts inbound emails – lot more email-based services coming in the future because of this.
- Time-based workflows – for example “7 days before opportunity close data create a task to send an email and create an approval escalation”
There are undoubtedly lots more – but this keynote doesn’t seem to be focussing on any hardcore developer details. Indeed, they speak about S-Controls and the like as if they’re all very new and that the audience won’t know much about them. I presume they’re right…
George then announced something new – AppSpace (with all their fonts and typesetting it’s hard to know how to write these names in plain text). It all happened rather quickly – but if I understand it right it’s essentially myspace for the enterprise. Customer portals on steroids. So you will be able to create your own “space” for your customers – customized, branded customer portals – that leverage the full Salesforce.com platform.
Aside: So what is this? An focused enterprise mashup tool? That’s how I see it. This is interesting, and potentially disruptive too. We recently had the IBM’s of the world coming out with their products in this space. Salesforce.com is here too now – all hosted, all on-demand. I look forward to hearing more details about this – Google is coming up empty right now ;-)
A nice little phrase George used: “written with clicks, not code”
Technorati Tags: appspace, saas, salesforce
News from the Salesforce Spring ‘07 keynote
I’m here at the Salesforce Spring ‘07 keynote. Lindsey Armstrong kicked things off by speaking about the growing on-demand industry. Demand for on-demand is high, and growing. Interestingly EMEA is experiencing a slightly higher growth than the US (52%). Of course on-demand is a disruptive and Lindsey appears to be quite confident that Salesforce is going to ride the wave.
I spoke to a number of customers in the “on-demand expo/breakfast” hall before the keynote, and of course they were all pretty positive too. “Customers want innovation, not infrastructure” – and that’s certainly something I saw from many of the partners.
Next up was Parker Harris – Founder & EVP, Technology. 550 applications on appexchange, answering one of my questions. (It’s little over a year old) He also spoke about appstore, making it easier to purchase the applications on appexchange.
Salesforce.com are developing a nice little ecosystem: Customers provide input via IdeaExchange, Developers participate in ADN, Salesforce.com provides the platform (Apex), and a marketplace (AppExchange), Commerce facilities to sell and use items in the marketplace (AppStore) – all centered around “availability/performance” provided by Salesforce.com of course.
Parker said something like “Coming soon and you’ll see more as my developers write the code”. Something that strikes me about Salesforce.com is how they have really embraced the “perpetual beta” that Tim O’Reilly talks about as a characteristic of the whole web 2.0 movement.
The winter release happened only a few months ago, and now we’re on the spring one (as it snows outside). That’s pretty dynamic and exciting – and of course because it’s all hosted all of the customers here in the hall have already upgraded.
Technorati Tags: saas, salesforce
Thinking about Salesforce Spring ‘07
You know how it is. You arrive in a foreign city, find something to eat, head back to your hotel and do a perfunctory google for developer oriented Salesforce speak and you end up on some really interesting blog, and you spend the next hour chasing related posts. This time it was James Governor in We’ll know Apex is Real if AppExchange starts making money for partners.
James has given me some excellent material to think about-I was after all looking for some juicy questions to ask the Salesforce folk at tomorrow’s event. The sentence that excites me the most is:
AppExchange really needs to be a market, not a platform. What matters most is creating opportunities for folks to make money.
How true. I’ve been spending some time thinking about mashups, monitizing mashups, monitizing the entire web 2.0 service-oriented culture, and what I really like is AppExchange. It does really appear to be a marketplace. It is also a marketplace where I can start applying my mashup skills, albeit in a limited context (Salesforce only). But still – it’s there now and I can start selling stuff tomorrow. That’s motivation.
Other questions James makes me want to ask:
- Tell me about data virtualization and partioning with Apex
- Tell me about all the ways I can construct enterprise web services to some of my data. Web services that have throttles, controls, authorization and the like. Web services that are transactional. That I can charge for.
I’ll let you know if I get any answers.
Technorati Tags: saas, salesforce
Salesforce Spring ‘07
So, I’m leaving for the SalesForce Spring ‘07 World Premier unveiling down in London tomorrow! I’m looking forward to it too. It’s good to get out and about and meet some of the folk behind all these tools. I want to get a feel for the ‘buzz’ – what does everyone think about it and how soon are they going to adopt the new features.
I just found the Spring ‘07 landing page and the release looks pretty promising. I’m particularly excited about the workflow enhancements. If they have wifi during the event (and it would be sin if they didn’t) I’ll be doing some live blogging about it too. Unfortunately I can’t find a landing page for the event itself, which is a little perplexing, so I don’t know if there will be wifi or not. Does anyone know?
If you want to meet up, let me know. I’m keen to gather any developer perspectives on the platform.
Technorati Tags: salesforce