4D v14

Video script

Home

 
4D v14
Video script

Video script  


 

 

Now we're going to learn about using a database in client/server mode.

Up until now, we've been programming in single-user mode; so let's look at how it works in client/server mode:

  • Let's quit 4D
  • We take the same database and start it on the server
  • The server starts and we see that there are currently 0 users
  • We start a client machine
  • We connect to a 4D Server
  • We choose the database we want from the list of published databases

And we see that in client mode:

  • We have the same interface and the same contents as before
  • We can display the technicians, the interventions
  • And perform all the same operations

Since 4D is multiplatform, the same server can distribute information to both Mac and Windows machines:

  • Let's switch to Windows
  • Start 4D.exe
  • Connect to the same server
  • And we have the same interface and the same data.

We can modify an intervention on Windows, and we'll immediately see those same modifications on Mac and vice versa.

The server also automatically manages record access conflicts. If we are editing a technician record and we want to open the same record on another client machine:

  • A message indicates that the record is already in use
  • And specifies the user, workstation and process concerned.

So much for data in client/server mode.

It just so happens that our development (tables, forms, methods, etc.) is also data: this is the programmer data.

The server also manages the impact of changes made on different machines, as well as the locking of "programmer" records.

Here, the [Intervention] input form is open; if we switch to Windows and finish; it opens the same [Intervention] input form but specifies that another user is currently working on  it.

If we hit OK, a lock indicates that the form is currently being used on another machine.

If we close the form on another machine and we go back to Windows, we can unlock the form by clicking on the padlock and then we'll be able to edit it.

The same principle applies to the structure:

  • We're going to close everything on Mac
  • Open the structure again
  • And so we have 2 identical structures
  • If we take the [Technicians] table and make the relation straight, we can automatically see the change made on Windows in the background.

This means that a team can develop simultaneously since we have access to:

  • the structure
  • the methods
  • the forms
  • and all the tools available for developers.

Naturally, any changes made in client/server mode can be used again in single-user mode since it's still the same structure and data.

This quick approach lets you see that is quite easy to develop either in a single-user environment or on several machines directly in client-server mode.

 
PROPERTIES 

Product: 4D
Theme: Switching to client/server mode

 
ARTICLE USAGE

Self-training ( 4D v13)
Self-training ( 4D v14)