Explanation of Directory Structure and Rules: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
(Created page with '== Introduction == This article describes the existing folder structure of the source code, and gives a short description of the contents and purposes. We will soon have more de…')
 
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Introduction ==
= Introduction =
This article describes the existing folder structure of the source code, and gives a short description of the contents and purposes.
This article describes the existing folder structure of the source code, and gives a short description of the contents and purposes.


We will soon have more detailed documentation of the source code, generated from the in-code comments.
See also the [http://codedoc.openpetra.org detailed documentation of the source code], generated from the in-code comments.


== C# Source code ==
See also [[OpenPETRA_Project_Structure_and_Namespace_Descriptions|OpenPETRA Project Structure and Namespace Descriptions]]!
All C# Source code is in the <code>csharp</code> directory.


Some Third-Party tools and dlls are in <code>csharp/ThirdParty</code>. Their license is compatible with the GPL, and each directory has a text file with the licensing details and links to the origin of that software.
= C# Source Code =
All C# Source code is found in the subdirectories of the <code>csharp</code> directory.


=== Ict.Common ===
== ThirdParty ==
The directory <code>csharp/ICT/Common</code> contains some general libraries, eg. connecting to different types of databases, a printing system, String Helper functions, etc.
Some Third-Party tools and DLL's are found in subdirectories of the <code>csharp/ThirdParty</code>. Their license is compatible with the GPL, and each directory has a text file with the licensing details and links to the origin of that software.


=== Ict.Petra.Shared ===
The code in directory <code>csharp/ICT/Petra/Shared</code> is intended to be shared between Server and Client. This means, that no access to the database is available in these files, since they must be run on the client as well, which does not have access to the database.


<code>csharp/ICT/Petra/Shared/Interfaces</code> is a special directory, which has Interfaces for functionality that the Server offers to the Client. Most of the interfaces are generated automatically, using <code>nant generateGlue</glue>.
== ICT.Common ==
The directory <code>csharp/ICT/Common</code> contains some general libraries, e.g. for connecting to different Relational Database Systems, a printing system, String Helper functions, etc.


<code>csharp/ICT/Petra/Shared/lib/RemotingSinks</code> contains code that is used to encrypt the communication between Server and Client, using a public/private key mechanism.
=== ICT.Common.Remoting.Sinks ===
This contains code that is used to [[N-tier architecture#Encrypted_Connection_between_Server_and_Client | encrypt the communication between Server and Client]], using a public/private key mechanism.


Then we have for each module a subdirectory, eg. <code>csharp/ICT/Petra/Shared/MPartner</code>, which contains Constants, and routines that can be useful on both the Server and the Client.


There is a data directory for each module, which contains generated code for matching the database tables to C# classes, and for defining typed datasets, eg. <code>csharp/ICT/Petra/Shared/lib/MPartner/data</code>. More documentation on this will follow soon.
== ICT.PetraTools ==
This contains several tools for generating code, some NAnt extensions for executing operations on the database, and much more. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra, except for the <code>Ict.Tools.PatchTool.exe</code>.


<code>csharp/ICT/Petra/Shared/MReporting</code> is another special directory specific to reporting functions that are used across all modules.


=== Ict.Petra.Server ===
== ICT.Testing ==
<code>csharp/ICT/Petra/Server/app</code> contains code that is necessary for the basic operation of the Server, eg. starting and maintaining app domains for each connecting client, connect to the database, etc.
Various Unit Tests and Integration Tests are found in subdirectories of this directory. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra.


The main PetraServerConsole.exe is compiled from a project in <code>csharp/ICT/Petra/Server/app/PetraServerConsole</code>.


<code>csharp/ICT/Petra/Server/lib</code> contains most of the business logic.
== ICT.Petra ==
The subdirectories under the <code>csharp/ICT.Petra</code> directory contain most of the C# source code that make up the OpenPetra application. The only other directories that contain such source code are the <code>csharp/ICT/Common</code> and <code>csharp/ThirdParty</code> directories.


There is a data directory for each module, which contains generated code for accessing the database, eg. <code>csharp/ICT/Petra/Server/lib/MPartner/data</code>. More documentation on this will follow soon.
=== ICT.Petra.Shared ===
The code in directory <code>csharp/ICT/Petra/Shared</code> is intended to be shared between Server and Client. This means that no access to the database is available through Classes in these files since the Classes can be used on the client side as well, and the Client side does not have direct access to the OpenPetra database.


TODO: we have not tidied up the connectors yet for all the modules. For the MFinance module we have a directory <code>csharp/ICT/Petra/Server/lib/MFinance/connect</code>. This should contain generated code for the server that provides the services to the client.


=== Ict.Petra.Client ===
<code>csharp/ICT/Petra/Shared/lib/data</code> contains Typed DataTables which match the definitions of the database tables. A Class exists for each OpenPetra database table. A programmer uses Typed DataTables to hold data relating to database tables in memory (details can be found [[Overview openPETRA architecture#Typed_DataTables | here]]); these Classes can't be used to access the database, though (that's what the [[Overview openPETRA architecture#DataAccess_Objects | DataAccess Classes]] are for). The Typed DataTables C# Classes are generated automatically, using the <code>nant generateORMdata</code> command. This directory contains generated code for all OpenPetra Modules.


=== Server Plugins ===
<code>csharp/ICT/Petra/Shared/Interfaces</code> contains C# Interfaces for functionality that the Server offers to the Client. Most of the interfaces are generated automatically, using the <code>nant generateGlue</code> command. This directory contains generated code for all OpenPetra Modules.


=== Server Admin ===
A subdirectory exists for each OpenPetra Module, e.g. <code>csharp/ICT/Petra/Shared/''MPartner''</code>, which contains C# files that define shared Constants and contain shared routines for that OpenPetra Module. These can be used on both the Server and the Client side.


=== Client Plugins ===
Under each OpenPetra Module subdirectory there is a 'data' directory which contains definitions of Typed DataSets for that OpenPetra Module, e.g. <code>csharp/ICT/Petra/Shared/lib/''MPartner''/data</code>. These C# Classes are generated automatically, using the <code>nant generateORMdata</code> command. More documentation on this will follow.


=== PetraTools ===


=== Testing ===
<code>csharp/ICT/Petra/Shared/MReporting</code> is not a true mapping to an existing OpenPetra Module that the user knows of. It contains reporting functions that are used across all OpenPetra Modules. These can be used on both the Server and the Client side.
 
 
=== ICT.Petra.Server ===
<code>csharp/ICT/Petra/Server/app</code> contains code that is necessary for the basic operation of the OpenPetra Server, e.g. Client connection, loading and maintaining AppDomains for each connecting Client, connecting to the database, etc.
 
The main PetraServerConsole.exe is compiled from a project in <code>csharp/ICT/Petra/PetraServerConsole</code>.
 
<code>csharp/ICT/Petra/Server/lib/data</code> contains generated C# Classes for accessing the database, so-called 'DataAccess Classes'. Details about the DataAccess Classes can be found [[Overview openPETRA architecture#DataAccess_Objects | here]] and information on how to use them can be found [[Using OpenPetra's DataAccess Objects | here]].
 
<code>csharp/ICT/Petra/Server/sql</code> contains a couple of more complex SQL queries which are much easier to read this way than encoded in strings inside the C# code.
 
A subdirectory exists for each OpenPetra Module, e.g. <code>csharp/ICT/Petra/Server/lib/''MPartner''</code>, which contains C# files that contain most of the Business Logic of OpenPetra.
 
The 'Module' subdirectories contain further subdirectories (not all need to exist for every Module!):
* \Module\''connect'' subdirectory: contains auto-generated Instantiators and any manually written UIConnectors
* \Module\''web'' subdirectory: contains WebConnectors
* \Module\''query'' subdirectory: contains Classes that execute (potentially a series of) database queries that are based on Parametrized SQL queries rather than our DataAccess Methods (usually these Methods load SQL files using Method 'TDataBase.ReadSqlFile'). The reason why this is done is either complexity or speed, or both. Also, memory consumption might be a factor if a huge amount of data would need to be held in memory if DataAccess Methods would be used instead of SQL queries. Mostly used by Extracts or Reports.
* \Module\''processing'' subdirectory: contains classes that are called from the PetraServers' Processing functionality (for processing data at certain intervals)
 
=== ICT.Petra.Client ===
<code>csharp\ICT\Petra\Client\app\</code> contains code that is necessary for the basic operation of the OpenPetra Client.
 
The main PetraClient.exe is compiled from a project in <code>csharp/ICT/Petra/PetraClient</code>
 
There are the directories <code>CommonForms</code>, <code>CommonControls</code> and <code>CommonDialogs</code>. They hold C# Classes which are used in many other windows of the OpenPetra Client.
 
There are directories for each OpenPetra Module, e.g. <code>MFinance</code>, <code>MPartner</code>, etc.
<code>MCommon</code> is not a true mapping to an existing OpenPetra Module that the user knows of. It contains code that is used across several OpenPetra modules.
 
Each OpenPetra Module directory has a subdirectory <code>Gui</code> which contains *.yaml files. These YAML Files are turned into generated C# Classes with the command <code>nant generateSolution</code>. <code>*.ManualCode.cs</code> files are holding C# code for everything that cannot be generated automatically.
 
 
=== ICT.Petra.ServerAdmin ===
This is a tool for connecting to the OpenPetra Server. It is used for shutting down the OpenPetra Server and it allows the OpenPetra Server administrator to check which users are currently logged in, among other things.
 
 
=== ICT.Petra.ServerPlugins ===
At the moment, we have a few plug-ins for authentication against another service, eg. phpBB.
 
 
=== ICT.Petra.ClientPlugins ===
We have for example a plug-in for importing German bank files.

Latest revision as of 09:46, 26 September 2016

Introduction

This article describes the existing folder structure of the source code, and gives a short description of the contents and purposes.

See also the detailed documentation of the source code, generated from the in-code comments.

See also OpenPETRA Project Structure and Namespace Descriptions!

C# Source Code

All C# Source code is found in the subdirectories of the csharp directory.

ThirdParty

Some Third-Party tools and DLL's are found in subdirectories of the csharp/ThirdParty. Their license is compatible with the GPL, and each directory has a text file with the licensing details and links to the origin of that software.


ICT.Common

The directory csharp/ICT/Common contains some general libraries, e.g. for connecting to different Relational Database Systems, a printing system, String Helper functions, etc.

ICT.Common.Remoting.Sinks

This contains code that is used to encrypt the communication between Server and Client, using a public/private key mechanism.


ICT.PetraTools

This contains several tools for generating code, some NAnt extensions for executing operations on the database, and much more. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra, except for the Ict.Tools.PatchTool.exe.


ICT.Testing

Various Unit Tests and Integration Tests are found in subdirectories of this directory. The resulting EXE's and DLL's are not shipped with an installation of OpenPetra.


ICT.Petra

The subdirectories under the csharp/ICT.Petra directory contain most of the C# source code that make up the OpenPetra application. The only other directories that contain such source code are the csharp/ICT/Common and csharp/ThirdParty directories.

ICT.Petra.Shared

The code in directory csharp/ICT/Petra/Shared is intended to be shared between Server and Client. This means that no access to the database is available through Classes in these files since the Classes can be used on the client side as well, and the Client side does not have direct access to the OpenPetra database.


csharp/ICT/Petra/Shared/lib/data contains Typed DataTables which match the definitions of the database tables. A Class exists for each OpenPetra database table. A programmer uses Typed DataTables to hold data relating to database tables in memory (details can be found here); these Classes can't be used to access the database, though (that's what the DataAccess Classes are for). The Typed DataTables C# Classes are generated automatically, using the nant generateORMdata command. This directory contains generated code for all OpenPetra Modules.

csharp/ICT/Petra/Shared/Interfaces contains C# Interfaces for functionality that the Server offers to the Client. Most of the interfaces are generated automatically, using the nant generateGlue command. This directory contains generated code for all OpenPetra Modules.

A subdirectory exists for each OpenPetra Module, e.g. csharp/ICT/Petra/Shared/MPartner, which contains C# files that define shared Constants and contain shared routines for that OpenPetra Module. These can be used on both the Server and the Client side.

Under each OpenPetra Module subdirectory there is a 'data' directory which contains definitions of Typed DataSets for that OpenPetra Module, e.g. csharp/ICT/Petra/Shared/lib/MPartner/data. These C# Classes are generated automatically, using the nant generateORMdata command. More documentation on this will follow.


csharp/ICT/Petra/Shared/MReporting is not a true mapping to an existing OpenPetra Module that the user knows of. It contains reporting functions that are used across all OpenPetra Modules. These can be used on both the Server and the Client side.


ICT.Petra.Server

csharp/ICT/Petra/Server/app contains code that is necessary for the basic operation of the OpenPetra Server, e.g. Client connection, loading and maintaining AppDomains for each connecting Client, connecting to the database, etc.

The main PetraServerConsole.exe is compiled from a project in csharp/ICT/Petra/PetraServerConsole.

csharp/ICT/Petra/Server/lib/data contains generated C# Classes for accessing the database, so-called 'DataAccess Classes'. Details about the DataAccess Classes can be found here and information on how to use them can be found here.

csharp/ICT/Petra/Server/sql contains a couple of more complex SQL queries which are much easier to read this way than encoded in strings inside the C# code.

A subdirectory exists for each OpenPetra Module, e.g. csharp/ICT/Petra/Server/lib/MPartner, which contains C# files that contain most of the Business Logic of OpenPetra.

The 'Module' subdirectories contain further subdirectories (not all need to exist for every Module!):

  • \Module\connect subdirectory: contains auto-generated Instantiators and any manually written UIConnectors
  • \Module\web subdirectory: contains WebConnectors
  • \Module\query subdirectory: contains Classes that execute (potentially a series of) database queries that are based on Parametrized SQL queries rather than our DataAccess Methods (usually these Methods load SQL files using Method 'TDataBase.ReadSqlFile'). The reason why this is done is either complexity or speed, or both. Also, memory consumption might be a factor if a huge amount of data would need to be held in memory if DataAccess Methods would be used instead of SQL queries. Mostly used by Extracts or Reports.
  • \Module\processing subdirectory: contains classes that are called from the PetraServers' Processing functionality (for processing data at certain intervals)

ICT.Petra.Client

csharp\ICT\Petra\Client\app\ contains code that is necessary for the basic operation of the OpenPetra Client.

The main PetraClient.exe is compiled from a project in csharp/ICT/Petra/PetraClient

There are the directories CommonForms, CommonControls and CommonDialogs. They hold C# Classes which are used in many other windows of the OpenPetra Client.

There are directories for each OpenPetra Module, e.g. MFinance, MPartner, etc. MCommon is not a true mapping to an existing OpenPetra Module that the user knows of. It contains code that is used across several OpenPetra modules.

Each OpenPetra Module directory has a subdirectory Gui which contains *.yaml files. These YAML Files are turned into generated C# Classes with the command nant generateSolution. *.ManualCode.cs files are holding C# code for everything that cannot be generated automatically.


ICT.Petra.ServerAdmin

This is a tool for connecting to the OpenPetra Server. It is used for shutting down the OpenPetra Server and it allows the OpenPetra Server administrator to check which users are currently logged in, among other things.


ICT.Petra.ServerPlugins

At the moment, we have a few plug-ins for authentication against another service, eg. phpBB.


ICT.Petra.ClientPlugins

We have for example a plug-in for importing German bank files.