• Session Chats

Breadcrumb

Filter

Chat

TimestampEntered ByComment
10:07:11Jeffrey KempCustomisable TAPIs + XAPIs FTW! :) <ducks and runs>
10:10:32Jeffrey KempI've found a lot of value in using TAPIs that provide bulk ins/upd/del operations useful to be called from XAPIs that provide the orchestration.
10:12:51syntegris information solutions GmbHSven Weller: Agree with JSON. I often write APIs to convert plsql collections into json. And even if it is just for logging purposes.
10:12:53Michael MooreI'm working on some JSON APIs right now
10:14:02syntegris information solutions GmbHJust to trace what values I have im my sometimes fairly complex collections. I convert them to json and write them to logger tables.
10:14:26syntegris information solutions GmbHYes
10:14:26mentzel iudithIn a real life application, with a table have many columns, it is maybe true that there are not too many types of INSERTS to that table, but it is very likely that there are lots of types of UPDATES, of different columns and combinations of columns. Is a TAPI supposed to contain ALL those types of different update statements ? Wouldn't this make the caller XAPI too cumbersome ?
10:18:04Jeff KempMost tables only need a single update procedure; the more complex tables typically have *groups* of columns that are typically updated at the same time; callers would choose the update procedure most appropriate for them; occasionally I'll add a new update procedure for particular purposes. Most complex TAPI I've worked with had maybe 7-8 update procedure variations.
10:18:36* Steven FeuersteinExcellent! Thanks for the real world experience.
10:22:31Pete KQuickSQL is handy for creating simple TAPI packages to play around with the concept.
10:22:43* Steven FeuersteinGreat point!
10:24:23mentzel iudithWhat about many variations of WHERE clauses. for updating a specific set of records ? I guess that the API will always update rows based on PK-s only, most of types probably using FORALL.
10:25:15Jeff KempIn my XAPIs, they query the table to determine which rows it wants to update (that's where the WHERE is); it then passes the array to the TAPI to update.
10:25:35syntegris information solutions GmbHSven: I agree with Chris. Where clause rarwly needed for updates. Where clause needed for the select which fetches the data. But rarly for the update.
10:25:45Michael MooreMuch more likely to get into where clause chaos with the select APIs. We have some wacky dynamic SQL to handle it
10:26:05Jeff KempNot always, of course. Depends on each situation :)
10:27:24Jeff KempI avoid dynamic SQL as much as possible.
10:27:54Jeff KempI like queries everywhere - in APEX, in XAPIs, etc.; but all ins/upd/del encapsulated in the TAPI.
10:28:20mentzel iudithThe WHERE clause for updating one table may be a result of some logic involving related but completely different tables than the one being updated. This means that we will need a superflouous query to be executed on the UPDATE target table, just for constructing the input PK-s for the update ...
10:29:22Jeff KempGood point mentzel
10:30:57mentzel iudithExactly, an XAPI can contain exactly and only the statements that you need executed, without necessarily limiting them to very rigid TAPI constructs.
10:34:29syntegris information solutions GmbHTAPI=Totally overrated API
10:35:20mentzel iudithThat's nice :)
10:35:37Pete KYou definitely want to call overloaded procedures with named parameters if there are a lot of similar overloads. Otherwise the compiler will decide which one to call...
10:37:22Pete K(or indeed fail like you've just demo'd ;-)
10:37:42Oren NakdimonAnother use-case for overloading: maintaining backward compatibility when adding a new OUT parameter to a procedure. Keep the old API and change its implementation to call the new API (and remove it when it becomes completely obsolete).
10:37:47Jeff KempI disagree - I require named parameters everywhere.
10:37:52mentzel iudithIt would be nice to have a flag or a compilation settings to enable/diaable implicit conversions for a given PL/SQL unit or session.
10:38:01syntegris information solutions GmbH+1 Oren
10:38:40Jeff KempUsing named parameters everywhere means you *can* safely add an overload and know it won't break existing code.
10:44:34syntegris information solutions GmbHI use subroutines like doCommit. The subroutine then has the commit and a flag to influence/change commit behaviour. Which is especially useful for testing purposes. During test I can switch off committing and roll back the test at the end.
10:46:46Jeff KempI prefer to let APEX handle the commits for me :)
10:49:07syntegris information solutions GmbHI like XAPIs / Business APIs. I don't like TAPIs. I think we have special use cases where they are useful, but not to generate them for each and every table.
10:49:11Michael MooreWhat works for many apps doesn't necessarily work for all apps.
10:49:43KarenAh, but some things need to work both in and out of APEX ... and then the commit on/off needs to be covered.
10:51:06mentzel iudithAPEX (and all stateless environments) might require complex enough logic to handle optimistic locking scenarios ... which is not always simple ...
  • 1 - 36