4th Dimension (software)

From Wikipedia, the free encyclopedia
  (Redirected from 4th Dimension (Software))
Jump to navigation Jump to search
4D Programming Language
Designed byLaurent Ribardière
Developer4D SAS
First appeared1984; 35 years ago (1984) (dev) 1987; 32 years ago (1987) (official)[1]
Stable release
v17.0 / 10 July 2018; 6 months ago (2018-07-10)
Preview release
v17R2
PlatformCross-Platform
OSWindows, macOS
LicenseProprietary
Filename extensions4DB, 4DC
File formatsInterpreted, Compiled
Websitedoc.4d.com
4D
Original author(s)Laurent Ribardière
Developer(s)4D SAS
Initial release1984; 35 years ago (1984) (ss) 1987; 32 years ago (1987) (v1)
Stable release
17.0 / 10 July 2018; 6 months ago (2018-07-10)[2]
Preview release
17R2
Written inC++, C
Operating systemWindows, Mac OS
TypeRAD RDBMS IDE Language GUI Designer Web Server
LicenseProprietary
Websitewww.4d.com
4D Server
Logo4D.jpg
Original author(s)Laurent Ribardière
Developer(s)4D SAS
Initial release1993; 26 years ago (1993) (v1)
Stable release
17.0 / 10 July 2018; 6 months ago (2018-07-10)[2]
Preview release
17R2
Written inC++, C
Operating systemWindows, Mac OS
TypeRDBMS Web Server Application Server SQL Server Database Server Language
LicenseProprietary
Websitewww.4d.com

4D (4th Dimension, or Silver Surfer, as it was known during early development) is a relational database management system and IDE developed by Laurent Ribardière.[3] 4D was created in 1984[4] and had a slightly delayed public release for Macintosh in 1987[5][6][7] with its own Programming Language[1]

The 4D product line has since expanded to a SQL back-end, integrated compiler, integration of PHP, and several productivity plug-ins and interfaces. Some of the plug-ins created by 4D include 4D Write (a word processor), 4D View (somewhat like a spreadsheet, but with extra functionality) and 4D Internet Commands (which let you add all sorts of Internet related functionality to a database). There are also over 100 third-party plugins, free and commercial.

4D can also be used as a web server, to run compiled database applications.

Today, 4D is published by the French company 4D SAS and has a sales, distribution and support presence in most major markets, with the United States, the United Kingdom, and France being the primary markets. The product is localized in more than a dozen languages, including English, French, German, Japanese, Hebrew, Arabic, Korean and Persian.

History[edit]

Silver Surfer, as it was known during early development, was developed by Laurent Ribardière in 1984. Following negotiations with Ribardiere it was planned that Apple Inc. (formerly Apple Computer Inc) would publish the software but Apple canceled the plan, reportedly due to pressure from other potential database publishers who claimed that if Apple had their own 'brand' database, 3rd party products would be disadvantaged in the marketplace.[8] Apple tried at the time to ensure well known software publishers supported the Macintosh platform and as a result, the project reverted to Laurent Ribardière, who with the French businesswoman Marylene Delbourg-Delphis published 4th Dimension. Although independently published, Apple supported the new venture and used 4D extensively throughout the organization for projects including fitness center management and CIM (Computer Integrated Manufacturing). A number of Apple personnel became 4D experts, including Lance McAndrew in Apple's Cupertino headquarters and Andrew O'Donoghue in Apple's Irish based European manufacturing headquarters, where a 4th Dimension application managed the entire European Service Center administration.

Over the next few years 4th Dimension's installed base grew and the publisher ACI, established a US-based subsidiary ACIUS, initially led by Guy Kawasaki. After 16 years of operating as ACIUS up to 2000, the name was officially changed to 4D Inc.[9]

In 1993, 4D Server v1.1, the client/server version of 4th Dimension was introduced along with the release of 4th Dimension v3.1.[10]

In 1995, 4D v3.5 went cross-platform and has since then supported both the Microsoft Windows and Apple Macintosh operating systems.[11]

In 1997, 4D v6 was the first version of 4D to contain a fully integrated web server, allowing developers to translate 4D forms into HTML on the fly using only the 4D language.[12]

In 2004, 4D 2004 was the first version of 4D to allow developers to create standalone, client/server, web and Service Oriented Applications (SOA)without changing any code.[13]

In 2008, 4D v11 added a SQL layer to the 4D database engine and extending native SQL in to the 4D programming language which allowed 4D developers to write native SQL code to connect to either local or remote servers[14][15]

In 2010, 4D v12 integrated the ability to execute PHP functions/scripts from within the 4D programming language. This version also supported new replication and synchronization commands and included a 64 bit version of 4D Server[16]

Version History[2][edit]

Branch Latest Version Initial Release Final Release Status Notable Firsts
v17.x v17.0 July 10, 2017 July 10, 2017 Supported ORDA (Object Relational Data Access), Collections, Object Notation, Dynamic forms
v16.x v16.0 January 10, 2017 January 10, 2017 Supported New Cache Management System, Preemptive Multithreading, 4D Dev Pro 64 bit
v15R v15R5 November 10, 2015 September 14, 2016 Superseded by 16.x preview of features to be in v16.x
v15.x v15.4 July 16, 2015 February 8, 2017 Supported '4D Server 64 bit for Mac OS X'; New network layer
v14R v14R5 May 2014 March 2015 Superseded by 15.x preview of features to be in v15.x
v14.x v14.6 Dec. 12, 2013 Dec. 20, 2016 Supported until Feb. 17, 2017 4D Mobile (Connectivity options for 4D Server as a datasource for Wakanda (software)); Structured JSON objects (C_Object); SQL views; new tools for maintenance and monitoring, new journaling system.
v13.x v13.6 Feb. 14, 2012 June 18, 2015 Not Supported New multithreaded HTTP server; automatic session management; new extensible HTTP client; webkit integration and extended Javascript support; enriched list box; external document management.
v12.x v12.6 June 3, 2010 October 8, 2013 Not Supported '4D Server 64 bit for Windows'; PHP integration; Synchronization and Replication
v11.x v11.9 Sept. 23, 2008 July 7, 2011 Not Supported SQL Engine; integrated maintenance center (MSC); SVG management; Integrated Web Area
2004.x 2004.8 Aug. 31, 2004 June 30, 2009 Not Supported Revamped interface; Integration of high-level ODBC commands, 4D Customizer, 4D Backup and 4D Engine
2003.x 2003.8r2 March 17, 2003 April 11, 2006 Not Supported XML; Web Services; Embedded Compiler
v6.8.x 6.8.6 April 15, 2002 September 24, 2004 Not Supported
v6.7.x 6.7.5 Not Supported
v6.5.x May 18, 1999 Not Supported
v6.0.x 6.0.5 1997 February 27, 1998 Not Supported Integrated Web Server
v3.x Not Supported 4D v3.5 was Cross-Platform (mac/win),
v1.x 1987 Not Supported
Silver Surfer 1984 Not Supported

Architecture[edit]

A 4D application can run in either Standalone mode or Client-Server mode.

Single-User[edit]

In Standalone mode, the 4D application (4D.exe on Windows or 4D.app on Mac) is used to open the structure file (4DB/4DC) file directly along with the associated data file (4DD).

Client-Server[edit]

In the Client-Server paradigm the 4D Server application (4DServer.exe on Windows or 4DServer.app on Mac) is used to open the structure file (4DB/4DC) file directly along with the associated data file (4DD). 4D may then be used in remote mode to connect to the 4D Server.

Application Editions[edit]

4D has two applications; 4D and 4D Server. 4D Server runs only as a server but 4D can be run in either standalone or remote mode.

4D[edit]

4D can be run in two modes. 4D in single-user mode allows for 1 person to run the application. 4D in remote mode is used for connecting to a 4D Server.

4D Server[edit]

4D Server is used for Client-Server connectivity to the application. In this mode, 4D Server loads the structure file (4DB or 4DC) and also the datafile (4DD) and provides network access to 4D (in remote). Each workstation has a dynamically updated cache of the resources they are working with, while the 4D Server maintains the data and code.

Syntax[edit]

This section will include syntax examples demonstrating different programming constructs used in 4D, such as for loops and variable usage.

Data Types[edit]

4D fields, variables, and expressions can be of the following data types:

Data Type Field Variable Expression
String Yes Yes Yes
Number (double) Yes Yes Yes
Date Yes Yes Yes
Time Yes Yes Yes
Boolean Yes Yes Yes
Picture Yes Yes Yes
Pointer No Yes Yes
BLOB Yes Yes No
Array No Yes No
Integer 64 bits Yes No No
Float Yes No No
Object Yes Yes Yes
Undefined No Yes Yes

More info on 4D data type can be found on the 4D Data Types documentation page

Variable Scope[edit]

Local variables are prefixed with a $ like $myLocalVariable and only live for the duration of the method.

Process variables have no prefix like myProcessVariable and live throughout the duration of the process.

Inter-process (or Global) variables are prefixed with a <> like <>myGlobalVariable and live throughout the duration of the application.

Comparison of looping[edit]

For[edit]

For(vCounter;1;100)
  // Do something
End for

While[edit]

 $i :=1 // Initialize the counter
 While($i<=100) // Loop 100 times
  // Do something
    $i :=$i +1 // Need to increment the counter
 End while

Repeat[edit]

 $i :=1 // Initialize the counter
 Repeat
  // Do something
    $i :=$i +1 // Need to increment the counter
 Until($i=100) // Loop 100 times

Optimizing loops[edit]

You can use Real, Integer, and Long Integer variables as well as inter-process, process, and local variable counters. For lengthy repetitive loops, especially in compiled mode, use local Long Integer variables.

Here is an example:

 C_LONGINT($vlCounter) // use local Long Integer variables
 For($vlCounter;1;10000)
  // Do something
 End for

Nested Loops[edit]

The following example goes through all the elements of a two-dimensional array:

 For($vlElem;1;Size of array(anArray))
  // ...
  // Do something with the row
  // ...
    For($vlSubElem;1;Size of array(anArray{$vlElem}))
       // Do something with the element
       anArray{$vlElem}{$vlSubElem}:=...
    End for
 End for

The following example builds an array of pointers to all the date fields present in the database:

 ARRAY POINTER($apDateFields;0)
 $vlElem:=0
 For($vlTable;1;Get last table number)
   // loop over each table number with $vTable as the number
    If(Is table number valid($vlTable)) 
      // check if table number $vTable is valid
      // only loop on the valid table 
       For($vlField;1;Get last field number($vlTable)) 
         // loop over each field number within current table 
         // with $vlField as the current field number
          If(Is field number valid($vlTable;$vlField))
            // check if field number is valid
             $vpField:=Field($vlTable;$vlField) // get pointer to field
             If(Type($vpField->)=Is date) 
               // check if current field is a date
               // only performs these actions if field is a date
                $vlElem:=$vlElem+1
                INSERT IN ARRAY($apDateFields;$vlElem)
                $apDateFields{$vlElem}:=$vpField
             End if
          End If
       End for
    End If
 End for

References[edit]

  1. ^ a b "High-End Mac Database Offers Own Programming Language". InfoWorld.
  2. ^ a b c "4D Product Lifecycle". 4D. Retrieved 2016-01-10.
  3. ^ "4D People - 4D". 4d.com.
  4. ^ "A History of Innovation". 4d.com.
  5. ^ "Overdue Apple Server Goes to Market". ComputerWorld.
  6. ^ "New Database Software Program Moves Macintosh Into The Big Leagues". chicagotribune.com.
  7. ^ "Seeking 4th Dimension? Take Heart, It`s Now In Town". chicagotribune.com.
  8. ^ Guy, Kawasaki (1989). The Macintosh Way (PDF). United States: Scott Foresman Trade. p. 18. ISBN 0673461750.
  9. ^ "Good Bye ACI US, Hello 4D, Inc". MacNews.com.
  10. ^ InfoWorld. 4D Server delivers on the promises of others. InfoWorld Media Group, Inc.
  11. ^ ComputerWorld. Database maker opens new Windows. ComputerWorld.
  12. ^ InfoWorld. 4th Dimension suitable for mixed Mac, Windows sites. InfoWorld Media Group, Inc.
  13. ^ "4D, Inc. Ships 4D 2004 Featuring a New Streamlined Design Environment and New Deployment Technologies | Business Wire". www.businesswire.com. Retrieved 2016-02-29.
  14. ^ "4D Announces the Worldwide Release of 4D Server V11 SQL". www.prnewswire.com. Retrieved 2016-02-29.
  15. ^ "4D Server v11 adds SQL, optimizes performance | MacNN". MacNN.com. Archived from the original on 2016-03-05. Retrieved 2016-02-29.
  16. ^ "4D v12 is Now Available". iClarified. Retrieved 2016-02-29.

External links[edit]