Hi Community!

Sometimes I meet a method which accepts 10+ parameters.

And often I need only the 8th parameter to pass. And I call the method something like:

do ##class(Some.Feature).Method(,,,,,,,"flag")

And I don't like this method when I call it like this cause, you know, often I just miss the number of commas and raise some other flag I wanted.

How do you avoid this situations?

If you meet such a code, how do you call it and sure that you didn't miss the number of ","?

What is a good number of parameters in a method and f you need to pass more parameters in a method what do you do?

3 27
1 1.5K
Discussion
· Jul 31, 2019
CodeGolf: FizzBuzz

Let's have a round of CodeGolf!

As usual the goal is to write the shortest solution for a specified problem.

Today we have one of the classics: FizzBuzz.

Write a program that prints the numbers from 1 to 100.

But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”.

For numbers which are multiples of both three and five print “FizzBuzz”

4 22
1 611

HI,

I am planning to build a WebApp that will have tons of data to display in tables, ability to add comments on that table rows and may be some few more small features as we move on.

1. It has to be Secure

2. It has to be fast

3. It has to be Non CSP / Non Zen

4. Will have Cache DB to pull records from but should be flexible to do that from any odbc resource

5. Version 2018 Ensemble

My first step would have been to investigate different options for technologies that would make it work and best suited with Ensemble 2018

0 18
1 435

Hello, InterSystems community!

Lately, you have probably heard of the new InterSystems Package Manager - ZPM. If you're familiar with it or with such package managers as NPM, Dep, pip/PyPI, etc. or just know what is it all about -- this question is for you! The question I want to arise is actually a system design question, or, in other words, "how should ZPM implement it".

4 14
0 314
Discussion
· Mar 19, 2019
Rule to validate SQL syntaxis

Hi! We have received a request to create a new rule on CachéQuality to identify when a developer uses double quotes (" ") within any SQL statement.

We have been asked many times about SQL validation rules, and we would like to open a debate to allow everyone discuss what would you like to be checked on a SQL statement.

Current examples are for basic situations:

0 13
0 534

Hi guys!

Suppose you developed a tool, framework, library on InterSystems ObjectScript for InterSystems Data Platform, share it via Open Exchange and want people to install it.

What is the best strategy if it is a library and supposed to be called from different namespaces?

Here are the following thoughts:

1. Tool's developer should be able to use globals to read/store data the tool needs.

2. Tool's consumer should be confident, that the thing he/she installs will not harm the application's data.

3. A tool should be callable from any application's namespace.

4. Tool's installation(in general) should not request manual security changes (e.g. grant the write access to IRISLIB) and %YourClass is not an option.

5. It's easy to uninstall the tool - just delete the namespace/database (maybe delete some web-apps too).

0 10
0 410

Hi all,

Over the next few months I'm going to be setting up continuous integration via Jenkins for some Angular UI's. The goal is to, on each build:

1. build the code

2. run the unit tests and get a report

3. get a code coverage report

Just wanted to poll the community in case someone else has already worked with any of this before. All ideas are appreciated.

Cheers,

Johnny

1 7
0 398

Hi Developers!

InterSystems IRIS stores everything in globals and if we use ObjectScript classes to persist data class documents globals it uses in storage. But if you use globals for calculations, temporary storages, for special indexes or for some other purposes - how do you document it?

Possible options which come to my mind:

1. Macro

#define Array ^MyGlobal

usage:

s $$$Array(1)=1

2. Class parameter

Parameter Array ="^MyGlobal";

Usage:

0 3
0 322

Hi Community!

There are two general ways to execute arbitrary SQL in serverside ObjectScript code: EmbeddedSQL and ObjectScript SQL a.k.a. Dynamic SQL.

E.g. if we want to get the value of the property of instance with a certain ID using SQL we can do:

&sql(SELECT Name INTO :name FROM Sample.Person WHERE ID=1)

write name

Same result with %SQL.Statement:

set rs=##class(%SQL.Statement).%ExecDirect(,"SELECT Name as name FROM Sample.Person where ID=1")
  do rs.%Next()
  write rs.name

1 2
0 899