User bio
404 bio not found
Member since Nov 6, 2015
Replies:

Very nice article

I would add some points:

  1. With regard to selecting a super class (extends)
  • %Persistent - if you want to store data
  • %SerialObject - if you want to provide a structure to be stored as part of a %Persistent class, but never as a separate object. (ie not a forgein reference)
  • %Registered - if you are creating a class that contains utilility methods or other in-memory only structures.  These classes will never store anything in the database. I would also add that IRIS supports multi-inheritence, which many languages do not.  So you can add capabilities to your classes by extending muliple classes.  For example Extends (%Persistent, %XML.Adaptor) creates a class that will support storage to the database and adds XML capabilities like import and export to the class 

   8. error handling

What you indicated is spot on.  I will add understanding and using Exceptions.  If you are working with a new code base using Exceptions for error handling versus returning %Status object is a more modern and better option. If you need to integrate into existing code the direction may be unclear.  In that case returning %Status values may be necessary.

Finally, I would add Post Conditionals that are available on most commands.  This replaces the need to wrap the execution of a single command in an IF statement.  For example, given your code defines an optional feature that is only processed if the feature option flag is turned on.  You could write

if option1 {
    do ##Class(Features.Option1).DoSomething()
}

 OR

do:option1 ##Class(Feature.Option1).DoSomething()

Dave, 

Interesting start into Angular.  If I might let me make a couple of suggestions

1) In your update method explicitly test for the put method.  If anything but POST or PUT is gets into this method return an error.  This can avoid security holes in the future or inadvertent changes.  Having gone through a few penetration testing rounds and it can be surprising how and where holes can be exploited.

2) You might want to investigate NG Formly.  This is a great module that allows you to describe your forms in code much like we used to do with ZEN and provides a lot of features.

3) I am not really sure what you truly gain by creating all your own custom components for field types.  That is a question not a criticism.  I would caution on this however as you may end up in the same bind that ZEN was in.  Where you want to use a neat new component you found but have to wrap it or do extra work to incorporate it into your framework.  Going back to item 2 NG Formly, or some other similar toole, may help here.

Certifications & Credly badges:
Rich has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following:
Rich has not followed anybody yet.