From a SuiteScript Dev job spec. Does anyone actua...
# suitescript
c
From a SuiteScript Dev job spec. Does anyone actually write OOP SS using SOLID principles?
e
with 2.1, yes, as much as I can
c
@ehcanadian A lot of SS I've seen doesn't really map well to OOP. It's hard to create classes/objects that actually make sense when you're just creating record and populating fields based on various bits of logic.
e
yeah, depends what I am working on. I use custom modules where I can, and in those I create classes and when I find myself duplicating logic, I subclass
s
NFT brings an more traditional OO feel to data access in a generalized way, among other things.
So while an ActiveRecord patterns fits well for a data access layer, we do not arbitrarily create additional classes just for fun where plain functions would suffice.
The sweet spot we've found is combining OO for data access (record CRUD and search results) combined with lite FP with libraries like immutablejs and lodash.
e
Personally I'm not a huge fan of class-oriented programming generally; I prefer to separate data from behavior completely, so my typical approach looks a lot more like Shawn's, maybe most similar to a Functional Core-Imperative Shell approach, but I'm not much of a purist in any one paradigm. I suppose I apply the
S
and the
I
from SOLID consistently, but I'm not usually thinking about SOLID.
d
I'm 100% OOP. SOLID is harder to achieve with multiple devs tough
c
I’m from a Java background so OOP and SOLID are well engrained into me; I’m not seeing any SuiteScripts that use OOP though. Most I’ve come across don’t have any of the standards markers of well engineered software / code.
d
Ya, I same here. I tried to play along in the functional world. But once I moved to TypeScript, I got to reignite my love for OOP
e
99.37% of SuiteScript I see is entirely procedural with little to no problem decomposition, and that's always disappointing.
d
So true @erictgrubaugh
e
feelsbadman
s
these are some of the reasons NFT exists