go to post Herman Slagman · Jun 29, 2021 The first question you should ask is: why do I need a composite primary key?In general, in Cache/IRIS you don't want to mess with the default key provided by %Persistent storage.In 99% of the cases, a unique index would be sufficient.
go to post Herman Slagman · Jun 22, 2021 You changed the question, my answer was for a DynamicObject/Array.For regular classes you use: ##class(%Dictionary.CompiledProperty).%ExistsId(ClassName_"||"_PropertyName)or just use a Try-Catch construct.
go to post Herman Slagman · May 26, 2021 You'll have to put the Try-Catch construct at the same dot-level: If 1 Do . Try { . Write a=b . } Catch e { . ZWrite e . }
go to post Herman Slagman · May 19, 2021 Xecute and indirection (@) are outside of the scope of a procedure. Change the label to: label(test) [routine] public Where [...] is the public-list, those variables are available outside the scope of a procedure. If you leave out the procedure brackets, all variable are 'globally' availabe.
go to post Herman Slagman · Feb 17, 2021 ClassMethod CreateApplication() As %Status [ CodeMode = objectgenerator ]{Set $ZTrap="Error"Set sc=$$$OKWrite !,"Creating Mitz API",!Set Here=$NamespaceSet URL="/mitz"Set $Namespace="%SYS"If ##class(Security.Applications).Exists(URL) {Write "Mitz API already exists",!} Else {Set Props("Name")=URLSet Props("NameSpace")=HereSet Props("Description")="Mitz notificatie API endpoint"Set Props("AutheEnabled")=64Set Props("DispatchClass")="LSP.Mitz.API"Set Props("MatchRoles")=":%All"Set Props("Type")=2 ; CSP AppSet sc=##class(Security.Applications).Create(URL,.Props)}Set $Namespace=HereReturn scErrorSet $ZTrap=""If $Data(Here) Set $Namespace=HereReturn $$$ERROR($$$GeneralError,"ErrorTrap: "_$ZError)}
go to post Herman Slagman · Feb 16, 2021 Kong Enterprise is currently on 2.3.x, what makes IAM so different from a rebranding of Kong Enterprise?Besides that, Kong Enterprise seems to be free of charge as of now, what is the benefit of using IAM?
go to post Herman Slagman · Feb 1, 2021 I'm not sure what you are trying to accomplish, JSON doesn't have tags and the example you provide is XML
go to post Herman Slagman · Sep 28, 2020 You only need Try-Catch when you expect that something might go wrong and can't handle it upfront.For regular error-handling, something that you anticipate never happens, the $ZTrap-ErrorHandler is much more elegant. It doesn't introduce extra stack-levels and identation. %Status is an elegant way of letting the caller know something went wrong and leave it to it's discretion to do with it whatever is appropriate, the callee should have done anything to handle the 'error' properly, logging, recovery, whatever. It's a matter of seperation of concerns.
go to post Herman Slagman · Aug 17, 2020 Method (or Function) overloading isn't necessarily an OOP-thing.Many programming languages only allow a constructor to have the name of the class itself.In COS you can have many constructors with different names and signatures, so overloading isn't really needed.
go to post Herman Slagman · Oct 12, 2019 About RESTfull... /search isn't really RESTfull, REST works on Resources (e.g. /persons or /orders) To query Resources you use GET (with parameters) But this is all very 'religious'. To use POST for a complex query is IMO defendable, but then I would do that on a Resource. You should have a look at the OData (Oasis) specification: https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata
go to post Herman Slagman · Sep 13, 2019 Anyone who is doubting multiple-inheritance is insane.Although calling this kind of inheritance 'mixin-classes' helps I've noticed, mixing in additional features.
go to post Herman Slagman · Aug 26, 2019 RobertYou're right it works, but ... you loose the method signature/contract.With a Method such as:Method(Name as %String, Address as Address, Age as %Integer)The compiler can enforce the right named arguments:Do Method(Age=32) -> OKDo Method(Car="Maserati") -> not OK (except for the car of course ;-))
go to post Herman Slagman · Aug 25, 2019 The only real solution is support of named arguments (like Python)They are on my ISC wish-list for many years ;-)To incorporate in COS-native is a challenge, but in Methods it shouldn't be so hard.
go to post Herman Slagman · Jul 20, 2019 Set sc=##class(%RoutineMgr).GetWebServerPort(.Port,.Server,.URLPrefix,.URL)