Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views5 pages

Delphi Assessment

This document provides instructions for an assessment on the Delphi framework. It addresses important concepts such as classes, inheritance, polymorphism, and access levels. In addition, it presents examples of implementing an FTP service class and using threads for background file downloads.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Delphi Assessment

This document provides instructions for an assessment on the Delphi framework. It addresses important concepts such as classes, inheritance, polymorphism, and access levels. In addition, it presents examples of implementing an FTP service class and using threads for background file downloads.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Delphi Evaluation 2017

Initial Instructions for conducting the evaluation

Only answer the questions you really have knowledge about;


consultations on the internet or in any other means are not recommended, since
The knowledge will be assessed in person in the next evaluation stage.

1) Considering the object model of Delphi, briefly define:


a.Class: model/project of an object, composed of fields,
methods, constructor and destructor, to be used in creation
instantiation at runtime.
b.Inheritance: creating a new class from a base class.
The new class inherits the characteristics (type/interface) of the class
base and, in some cases, the implementation (code).
c.Polymorphism: invocation of a method in different classes
produce different results. Ex: Circle.Draw() and
Triangle.Draw()
Fields or attributes store the object's data.
e.Properties: facilitating resource that allows access to the fields of
object through a simple name. However, in the implementation
both the field and routines for access can be assigned to
these, allowing data processing before access to
fields.
f.Constructors: blocks of code executed automatically upon
create (instantiate) a new object.
Virtual methods: virtual methods are those that can be
overwritten by their descendants, that is, if class A has
a virtual M1 method that calculates the tax X1 and I need
a class B that calculates the same tax X1 and the tax X2,
I create class B inheriting from class A, I override the method
virtual M1 in class B, I invoke method M1 from class A (in B) and
I implement the code for the calculation of tax X2;
Access levels (sections): the sections of Delphi
interface: declaration of information visible to other units
(units) (CONST, var, classes, methods, etc.)
implementation of the section statements
interface and other internal implementations of the unit.
initialization: code to be executed when loading the
unit in memory for application execution.
Generally used to register classes and components.
finalization: code to be executed when the unit is
cleared from memory. Usually performs cleanups.

2) What is meant by RTTI (Run Time Type Information)? Give an example of its utility.
of this resource?

RTTI allows for the discovery of information about a specific artifact.


(classes/objects etc.) at runtime of the application. Useful for
to know if a certain class/object has a method or property.
Delphi Evaluation_2017

3) What is 'overloading' of routines? Give an example?

It is when we define two or more routines with the same name but with
different “signatures”, that is, a different list of
parameters/arguments. Ex:
In DUnitX we have class methods:

IsNull(const condition: TObject; const message: string = ""); overload;


IsNull(const condition: Variant; const message:string = ""); overload;

Highlight the changes. The runtime itself invokes the method.


appropriate based on the parameter.

4) Implement a class (component) that performs the basic operations of a


FTP client service (through a DLL, for example), that is: connect,
send and receive files, disconnect. This implementation must contain
methods (it is necessary that these concepts appear: constructor, destructor,
virtual, overload, override), properties (minimum of 4) and events (minimum of 2).
It is not necessary to develop the code of the methods.

TFtpService = class(TComponent)
private
string
string
string
FileList: TStringList;
FOnBeforeConnect: TNotifyEvent;
TNotifyEvent;
TNotifyEvent;
function GetFileList: TStringList;
public
property Host: string read FHost write FHost;
property User: string read FUser write FUser;
string read FPassword write
FPassword;
property FileList: TStringList read GetFileList;
constructor Create(AOwner: TComponent); override;
overload;
constructor Create(const Host, User, Password: string);
overload
destructor Destroy;
function connect: Boolean; overload;
function connect(const Host, User, Password: string):
Boolean; overload;
function disconnect: Boolean;
function addFile(const FileName: string): Integer;
function removeFile(const FileName: string): Boolean;
function uploadFiles: boolean; virtual;
function downloadFiles: boolean; virtual;
end;
Delphi Assessment 2017

5) Imagine that you need to develop a system that sweeps a


determined FTP address in search of files. When found, it will be done
to download and subsequently delete it, and so on until
the system is completed. It is necessary to show in a form how many files
have been downloaded since the system startup. This is requesting the
implementation of a class TThread. Let's get to work; implement this class
with the use of the component from item 4. Develop only the structure of the
class and the code of the method 'Execute'.

I work very little with TThread in Delphi. I need a little bit of


training. I master the concepts but I use them much more in Java/Android.

6) Imagine the following situation: Your executable is occasionally (rarely: 1


in 100) generating an "access violation" when closing a certain
form. At the closing of this form, memory is released from several
components (from Delphi, proprietary and third-party). Describe the attitudes that
you would take to solve this problem.
What I have seen in practice is that mistakes happen when one tries to
access a null pointer (to objects, components, etc.). Would insert
a log in the release of such components to verify/register their
state (whether nil or not, for example). If you use EurekaLog, it already
provide a very complete log with the objects/components, line
where the error occurred, trace etc.

A good Delphi programmer worth their salt builds an environment of


development that is not limited to Delphi software. It consults
documentation, books, and helps; uses other software; needs to update and
to constantly learn about new things through periodic publications or on the Internet.
What rabbits do you have in the hat?
In addition to Delphi, in terms of software, data modeling application
(Visio), unit tests (DUnitX), debug, error log, memory leaks etc.
(EurekaLog, by the way, excellent!). The Delphi help has improved a lot in
latest versions and is a mandatory reference source, just like the website of
Embarcadero. Some books on the Object Pascal/Delphi language by Marco
Cantù and for advanced topics Steve Teixeira and Xavier Pacheco beyond
from DanieliTeti's book (I believe it is Delphi CookBook, very good).
On the web, the starting point I use is DelphiFeeds.com.

Imagine a CASH system, where it has the function of selling products.


and carry out the receipt of the sale. The database structure of this
the most powerful system is as follows:

1-Movement 2-Items 3-Payments 4-Products


Launch-key Launch-key Launch – Product code - key
primary primary primary key primary
Data—data of Connection movementConnection movementDescription -
movement product description
Tpmov - Type of Product code - code. Tpdoc - Type of Family-family of
movement Product document product
Quantity– Value - amount paid Value - Value
products sold unit sale
Value Venc – due date
Unit Product
Delphi Assessment_2017

5-Family 6-TpDoc
Family - Key Tpdoc - Key
primary primary
Description - Desc. Description -
Family Family Description

Where:
Sales Movement Table
Table 2 := Table of sold items (products) of the movement;
Table 3 := Table of payment methods for transactions;
Table 4 := Product table;
Table 5 := Table of product families;
Table 6 := Table of payment methods (cash, check, pre-check, etc...)

The store owner, where his system is operating, wants to analyze the data obtained in
an operating period.
Build the SQL lines for the following visualizations:

1. View the items sold from 01/08/2007 to 20/08/2007,


presenting transaction date, Description of the type of transaction (not the
code
total; sorting and grouping by product.

SELECT p.Product Description, m.date, t.Movement Type Description


Quantity
FROM Movimento m
INNER JOIN Items I on m.Entry = i.movement
INNER JOIN TpDoc t on m.Tpmov = t.Tpdoc
INNER JOIN Product p on i.ProductCode = p.ProductCode
WHERE m.Data BETWEEN '2007-08-01' and '2007-08-20'
GROUP BY p.Description
ORDER BY p.Description

2. Visualize how much was received (R$) from (cash, check, etc...) in the month
08/2007
summarized;

SELECT t.Description Payment_Type, sum(p.Value) Total_Value


FROM Movement m
INNER JOIN Payments P on m.Entry = p.movement
INNER JOIN Tpdoc t ON p.Tpdoc = t.Tpdoc
WHERE M.data between '2007-08-01' and '2007-08-31'
GROUP BY p.Tpdoc

3. Taking advantage of the above logic, write an SQL line that performs the insertion of
a new product in the product table.

No auto increment in the product code


Delphi_2017 Evaluation

INSERT INTO Products (ProductCode, Description, Family, Value) values ('1234',


'NEW PRODUCT', 1, 10.90

With auto increment in the product code


The input text is incomplete, please provide the complete text for translation.
NEW', 1, 10.90)

General Questions

1. Describe your knowledge in the tax/accounting area.

Basics for implementing routines for tax assessment (ICMS, PIS, COFINS, IPI, ISS,
tax substitution etc.) as well as debit/credit entries, reconciliation, balance sheet of
verification, balance sheet, income statement. Accrual/cash basis. managerial accounting.

3. What is your experience in system requirements specification (ERP)?

Experience of approximately 10 years.

4. Which ERPs do you know?

Microsiga, SAP R3 (ABAP)


5. What is your salary expectation as a CLT?

Are you available to start immediately?

Yes.

7. If you do not have residency in Botucatu, how do you plan to proceed if you are approved for this position?

I will move as soon as possible.

8. How did you become aware of the .Net position at Consciência?

By the Apinfo website.

Some personal information would be interesting to get to know you a little better.

Feel free to add any comments you deem necessary.

Important: Insert resume at the end of this document.

Do not send the resume separately.

Good Evaluation

You might also like