Today I spent a few hours with my father learning about Apex. It was the first time I’ve used Apex in an IDE. Actually, the IDE was IntelliJ, which is what I’ve been using for Java. So that’s good. I suppose it will be good enough to just familiarise myself with that and the developer console. Dad prefers the IDE to the developer console. I can also do JavaScript in the IDE as well.

These are the sorts of details that always puzzled me about development. Things like where does the coding actually take place? How does the code know which system to relate to? Today there were a lot of details that we covered.

I learned about how classes are used in Salesforce to store code. You can then refer to those classes with other code, such as with a trigger, open execute anonymous and other classes. Or more likely, refer to methods within those classes.

There was quite a lot of focus on syntax. I saw coding in action, and therefore the syntax that was used. Thimgs like “myClass.method”. Or Account a = new Account.

I learned some more abstract lessons about coding. For example the reason you might create new account a and another one b. The meaning of static (single instance) and void (returns nothing). I was pleased that I already understood public and private pretty well.

I learned about constructors. About those statements where you declare the class or the method. What that “promises”. For example, does it promise a string when you run that method. I saw an example of method overloading, which I was familiar with.

On a more human level I feel like today was a good reference experience for how to be in the workplace when working in tech. I noticed a lot of crossover between this and meditation. What I mean is that I had an object upon which to continually refocus my attention (the task or subject matter at hand) but also I found it effective to practise patient loving-kindness towards myself when my mind wandered. I find that practising this towards oneself makes you feel that way towards others and it makes the workplace better overall. So there’s a balancing act between active communication, focus and attitude towards imperfection.

Below is the program(s) that we designed today.

Screen Shot 2018-03-26 at 14.51.24Screen Shot 2018-03-26 at 14.53.49

There is a trigger on the Account object, which updates a field based on a method within a class, which is pictured below. The method accepts type and returns free if it’s education, otherwise, it returns commercial. This string returned is what the trigger updates the license type field to.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s