Dojo tuba delphi
-
Upload
rodrigo-vaccari -
Category
Documents
-
view
372 -
download
1
Transcript of Dojo tuba delphi
![Page 2: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/2.jpg)
Um pouco de história
• 1995 – Lançamento – 16 bits• 1996 – Versão 32 bits• 2001 – Kylix• 2003 – Delphi 8 .Net• 2006 – CodeGear• 2008 – Embarcadero• 2009 – Prism• 2011 – Versão 64, Mac, iOS, Cloud, FireMonkey
![Page 3: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/3.jpg)
Curiosidades
• Anders Hejlsberg – Criador das linguagens: Delphi, J++, C#
• Lazarus– Free e Multiplataforma
• Projeto ACBr
![Page 4: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/4.jpg)
Sobre
• Visual• Orientada a Objetos• Orientada a eventos• Compilada
![Page 5: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/5.jpg)
Hello World
![Page 6: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/6.jpg)
Delphi x Java x PHP
Função em Java:private double dividePorDois(double numero){
double resultado = numero/2;return resultado;
}
Função em PHP:private function dividePorDois(numero){
$resultado = $numero/2;return $resultado;
}
Função em Delphi:function dividePorDois(numero: integer): Double;var resultado: Double;begin resultado := numero/2; Result := resultado;end
![Page 7: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/7.jpg)
Classes Delphi x Java
Classe em Java:public class Nota {
private double valor;
public Nota(double valor){this.valor = valor;
}
public void setValor(double valor) {this.valor = valor;
}
public double getValor() {return valor;
}}
Classe em Delphi:type TNota = class private FValor: Currency; protected function GetValor: Currency; procedure SetValor(value: Currency); public constructor Create(valor: Currency); published property Valor: Currency read GetValor write SetValor; end;
implementation{ TNota }
constructor TNota.Create(valor: Currency);begin FValor := valor;end;
function TNota.GetValor: Currency;begin Result := FValor;end;
procedure TNota.SetValor(value: Currency);begin FValor := value;end;
![Page 8: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/8.jpg)
Sobre testesDUnitPresente no Delphi desde a versão 2005
uses TestFramework, SysUtils;
type TestCalass = class(TTestCase) strict private public procedure SetUp; override; procedure TearDown; override; publishedend;
![Page 9: Dojo tuba delphi](https://reader036.fdocumentos.com/reader036/viewer/2022082607/55932e0a1a28ab524e8b45b0/html5/thumbnails/9.jpg)
interface
uses TestFramework, SysUtils, uCalculadora;type TestTCalculadora = class(TTestCase) strict private FCalculadora: TCalculadora; public procedure SetUp; override; procedure TearDown; override; published procedure TestSomar; end;
implementation
procedure TestTCalculadora.SetUp;begin FCalculadora := TCalculadora.Create;end;
procedure TestTCalculadora.TearDown;begin FCalculadora.Free; FCalculadora := nil;end;
procedure TestTCalculadora.TestSomar;var ReturnValue: Integer; valor2: Integer; valor1: Integer;begin valor1 := 2; valor2 := 2; ReturnValue := FCalculadora.Somar(valor1, valor2); CheckEquals(4, ReturnValue, 'Erro ao efetuar a soma');end;
initialization // Register any test cases with the test runner RegisterTest(TestTCalculadora.Suite);