Formação Desenvolvimento em .Net – Estruturas Básicas

Como disse anteriormente, esta formação foi direccionada para pessoas com bons conhecimentos de programação, embora no caso concreto de uma linguagem com poucas semelhanças com as linguagens .net.
De qualquer forma algumas das instruções básicas (ciclos, condicionais, etc.) são bastante parecidas daí que sempre que possível tentei comparar o que temos disponivel em .Net e o que eles já conheciam do Progress

Os objectivos foram os seguintes:
Estruturas Básicas
O1 – conhecer diferentes tipos de dados
O2 – identificar semelhanças entre tipos de dados .Net e Progress
O3 – saber dimensionar variáveis e atribuir-lhes valores
O4 – perceber diferença entre dimensionar e instanciar uma variável
O5 – identificar âmbito (scope) das variáveis
O6 – saber converter entre tipos de dados
O7 – perceber restrições nas conversões entre tipos de dados
O8 – perceber utilização de constantes
O9 – identificar e saber utilizar estruturas de ciclo
10 – identificar e saber utilizar estruturas condicionais
11 – saber utilizar Function e Sub para estruturas aplicações
12 – ter a noção das funções matemáticas existentes em .Net e correspondência com Progress

E esta foi a apresentação utilizada

E aqui ficam alguns links de referência:

Programming VB.NET: A Guide for Experienced Programmers, GARY CORNELL AND JONATHAN MORRISON
.NET Framework Home Page
OpenEdge™ 10.0B PDF Documentation
vb.net vs c#
Coersion Aversion
Using Option Explicit
Visual Basic Language Reference  – Option Strict Statement
Why we need Option Strict Off
Option Strict and Option Explicit in VB.NET 2005
Visual Basic Language Reference – DirectCast
Avoid using magic numbers and string literals in your code
Passing parameters to functions and procedures
VB.NET Optional Paramaters: And Why to Avoid Them

Share

Formação Desenvolvimento em .Net – Introdução

O primeiro módulo da primeira sessão foi uma justificação do porquê desta formaçao. Porque queremos mudar, porque temos que mudar. Novos desafios por parte dos clientes e novas oportunidades tecnológicas fazem com que o desenvolvimento hoje seja diferente do desenvolvimento há 5/10 anos.
Depois falei sobre o porquê da opção .Net (e não Java) e porquê VB e não c#, tentei deixar a ideia de semelhança a nivel de funcionalidades disponiveis entre as duas plataformas e frisei que simplesmente uma opção pessoal me levou na altura para a formação em VB.net e não C#
Finalmente, como não poderia faltar numa primeira lição numa nova linguagem de programação fizemos um programa “Hello World”, com a particularidade de ser feito no notepad e compilado na linha de comando, só como prova de conceito. Sim o .net também pode ser programado no notepad, mas provavelmente não faz muito sentido.

Os objectivos foram os seguintes
Introduzir conceitos sobre frameworks de desenvolvimento
O1 – Enumerar quais as forças externas que exigem a evolução no software
O2 – Identificar semelhanças / diferenças entre as frameworks .net e Java
O3 – Identificar semelhanças / diferenças entre C# e VB.Net
O4 – Perceber como é executada uma aplicação e comparar com execução de programas progress
O5 – Enumerar ambientes de desenvolvimento .Net
O6 – Saber criar um projecto vb.net em visual studio 2003
O7 – Identificar ferramentas básicas de debug

Aqui fica a apresentação usada como apoio

E aqui ficam alguns links de referencia

Programming VB.NET: A Guide for Experienced Programmers, GARY CORNELL AND JONATHAN MORRISON
.NET Framework Home Page
Six Lessons from the “Mainstream” Software
The BCG Growth-Share Matrix
The experience curve
the bcg matrix product portfolio method
BCG growth-share matrix
java vs .net
Comparing Java and .NET Security: Lessons Learned and Missed
Comparing Java and .NET
Microsoft .NET vs. J2EE: How Do They Stack Up?
101 Reasons Why Java is Better than .NET (Reloaded)
Java vs .NET
J2EE vs .Net: The choice depends on your needs
Java vs. .NET, part 1 – Usability
evolução linguagens programação
vb.net vs c#
Drill Into .NET Framework Internals to See How the CLR Creates Runtime Objects
Rewrite MSIL Code on the Fly with the .NET Framework Profiling API
Internals of .NET/Rotor CLR
The Common Language Runtime (CLR)
Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework
OpenEdge Deployment: Managing 4GL Applications – R-code Features and Functions
OpenEdge Deployment: Application Portability – Programming Considerations
Exploring alternatives to Visual Studio.NET

Share

Formação Desenvolvimento em .Net

Quando entrei para a Infos, ficou definido que umas das minhas tarefas era partilhar o conhecimento que eu tinha de desenvolvimento em plataformas Microsoft, mais propriamente na framework .net, com os meus colegas de departamento.
A Infos foi desde sempre, ou pelo menos desde que me lembro, uma empresa focada no motor de base de dados e 4gl Progress e o objectivo era de alguma forma começarmos a integrar estes dois mundos: Progress e .Net.
Nessa perspectiva foi-me proposto desenvolver os conteúdos necessários para depois ministrar um curso que fizesse este tipo de ponte.
A minha perspectiva aqui foi de dar uma panorâmica de tudo o que a framework nos proporciona de forma a, mais do que deixa-los aptos para começar um projecto a partir do zero, deixa-los com a ideia das funcionalidades que tinham disponiveis dentro da framework.
Não foi por isso a típica formação de introdução a uma nova linguagem com a apresentação exaustiva de todos os tipos de dados, construtores condicionais e de loops, etc.
Procurou-se também, sempre que possível fazer a ligação enter o mundo Microsoft e o mundo Progress.
A formação foi dividida em 4 sessões que corresponderam aproximadamente a quatro dias.
- Sessão 1 – Introdução; Estruturas Básicas; Objectos Específicos .Net e Visual Studio; Boas Práticas no desenvolvimento
- Sessão 2 – Introdução ao Visual Studio; Programação Orientada Objectos (Introdução, Herança e Interfaces); Eventos; Excepções
- Sessão 3 – A Framework – Assemblies mais importantes; User Interface; Acesso a Dados; DataBinding
- Sessão 4 – Reflection; Dados vs Objectos; A Framework nHibernate; Testes Unitários e a Framework nUnit; Deployment
Nos próximos dias vou disponibilizar aqui todos os conteúdos e recursos que desenvolvi e utilizei nessa formação.
Algumas coisas já estão “fora de prazo” já que a formação foi em cima do Visual Studio 2005 mas pelos menos os conceitos continuam actuais.

Share

The Mythical Man-Month


Pode parecer estranho mas acabei de ler um livro sobre tecnologia, melhor sobre desenvolvimento de software, que foi escrito há 33 anos.
Para além da eventual afinidade que poderia ter por ler um livro que tem exactamente a minha idade, a verdade é que o que me levou a ler o ‘The Mythical Man-Month’ foi o reconhecimento que muitas pessoas ainda hoje revelam sobre o livro.
‘The Mythical Man-Month’ é um conjunto de artigos escritos como resultado do desenvolvimento do sistema OS/360 e do reconhecimento do que correu menos bem ou mesmo mal e tentativa de explicação desses erros.
E a verdade é que, com muita pena minha, consegui rever uma grande parte da minha vida profissional aí reflectida… é triste saber que estou a repetir erros que foram identificados há 33 anos…
Continue reading

Share

notas leitura: The Mythical Man-Month 3

capítulo 14 – hatching a catastrophe
pag. 154
“When one hears of disastrous schedule slippage in a project, he imagines that a series of major calamities must have befallen it. Usually, however, the disaster is due to termites, not tornadoes; and the schedule has slipped imperceptibly but inexorably.”
“Concrete milestones, on the other hand, are 100-percent events. (…) source coding 100 percent complete, keypunched, entered into disk library, debugged version passes all test cases. These concrete milestones demark the vague phases of planning, coding, debugging”

pag. 156
“But every boss needs two kinds of information, exceptions to plan that require action and a status picture for education. For that purpose he needs to know the status of all his teams. Getting a true picture of that status is hard.”

pag.158
“The project manager has to keep his fingers off the estimated dates, and put the emphasis on getting accurate, unbiased estimates rather than palatable optimistic estimates of self-protective conservative ones.”

capítulo 15 – the other face
pag. 165
“Different levels of documentation are required for the casual user of a program, for the user who must depend upon a program, and for the user who must adapt a program for changes in circumstance or purpose.”

“To believe a program. The description of how it is used must be supplemented with some description of how one knows it is running. This means test cases.”
pag. 166
“1. Mailine cases that test the program’s chief functions for commonly encountered data.
2. Barely legitimate cases that probe the edge of the input data domain, ensuring that largest possible values, smallest possible values, and all kinds of valid exceptions work.
3. Barely illegitimate cases that probe the domain boundary from the other side, ensuring that invalid inputs raise proper diagnostic messages.”

capitulo 16 – No Silver Bullet – Essence and Accident in Software Engineering
pag. 199
“The hardest single part of building a software system is deciding precisely what to build. No other part of the conceptual work is so difficult as establishing the detailed technical requirements, including all the interfaces to people, to machines, and to other sofware systems. No other part of the work so cripples the resulting system if done wrong. No other part is so more difficult to rectify later.
Therefore the most important function that software builders do for their clients is ther iteractive extraction and refinement of the product requirements. For the truth is, the clients do not know what they want. They usually do not know what questions must be answered, and the almos never have thought of the problem in the detail that must be specified. Even the simple answer – “Make the new software system work like our old manual information-processing system” – is in fact too simple. Clients never want exactly that. Complex software systems are, moreover, things that act, that move, that work. The dynamics of that action are hard to imagine. So in planning any software activity, it is necessary to allow for an extensive iteraction between the client and the designer as part of the system definition.
I would go a step further and assert that it is really impossible for clients, event those working with software engineers, to specifiy completely, precisely, and correctly the exact requirements of a modern software product before having built and tried some versions of the product they are specifying.”

pag.200
“Incremental development – grow, not build, software”

pag.241
“The programmer delivers satisfaction of a user need rather than any tangible product”


Nome: The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition)
Autor: Frederick P. Brooks
Editora: Addison-Wesley Professional; 2 edition (August 12, 1995)
ISBN-13: 978-0201835953

Share

notas leitura: The Mythical Man-Month 2

capítulo 9 – ten pounds in a five-pound sack
pag. 100
“Fostering a total-system, user-oriented attitude may well be the most important function of the programming manager.”

capítulo 10 – the documentary hypothesis
pág. 111
“Why have formal documents?
First, writing the decisions down is essencial. Only when one writes do the gaps appear and the inconsistencies protrude. The act of writinh turns out to require hundreds of mini-decisions, and it is the existence of these that distinguishs clear, exact policies from fuzzy ones.”

capítulo 11 – plan to throw one away
pag. 117
“… both the actual need and user’s perception of that need will change as programs are build, tested and used.”
pag. 118
“Quantization of change is an essential technique. Every product should have numbered versions, and each version must have its own schedule and a freeze date, after which changes go into the next version.”
“…the reluctance to document designs is not due merely to laziness or time pressure. Instead it comes from the designer’s reluctance to commit himself to the defense of decisions which he knows to be tentative.”
pag. 121
“Program maintenance involves no cleaning, lubrication, or repair of deterioration. It consists chiefly of changes that repair design defets.”
pag. 122
“… the total number of module increases linearly with release number, but that number of modules affected increases exponentially witn release number. All repairs tend to destroy the structure, to increase the entropy and disorder of the system…”
pag.123
“Systems program building is an entropy-decreasing process, hence inherently metastable. Program maintenance is as entropy-increasing process, and even its most skillful execution only delays the subsidence of the system into unfixable obsolescence.”

capitulo 13 – the whole and the parts
pag. 142
“… conceptual integrity of the product not only makes it easier to use, it also makes it easier to build and less subject to bugs.”
pag. 144
“Many poor systems come from an attempt to salvage a bad basic design and patch it with all kinds of cosmetic relief”
pag. 147
“The unexpectedly hard part of building a programming system is system teste. (…) one should be convinced of two things: system debugging will take longer than one expects, and its difficulty justifies a thoroughly sysematic and planned approach.”


Nome: The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition)
Autor: Frederick P. Brooks
Editora: Addison-Wesley Professional; 2 edition (August 12, 1995)
ISBN-13: 978-0201835953

Share

Brincar aos servidores

3 horas depois… aqui ficam uns links que me ajudaram, caso volte a precisar

Share

sql convert date format

Eu sou um bocado paranóico em relação às conversões entre tipos de dados, provavelmente porque tive que conviver muito tempo com pessoas que faziam coisas fantásticas como gravar datas ou números em campos de texto.
No entanto há situações em que temos mesmo que fazer este tipo de conversões, normalmente para gerar outputs, e um dos casos mais comuns é converter uma data para uma string.
Esta operação aparentemente trivial levanta um conjunto de questões que têm essencialmente a ver com o formato que cada língua tem para a data, por exemplo quantos números considerar para o ano, dois ou quatro? qual o formato da data, dd-mm-aaaa, aaaa-mm-dd, mm-dd-aaaa? e qual o separador ‘/’, ‘-’, ‘.’?
Felizmente o sql server já inclui o conjunto de conversões mais habitual que listo em baixo.
convert(varchar(50), getdate(), opcao)

  • opcao = 0 – Aug 27 2007 10:20AM
  • opcao = 1 – 08/27/07
  • opcao = 2 – 07.08.27
  • opcao = 3 – 27/08/07
  • opcao = 4 – 27.08.07
  • opcao = 5 – 27-08-07
  • opcao = 6 – 27 Aug 07
  • opcao = 7 – Aug 27, 07
  • opcao = 8 – 10:17:36
  • opcao = 9 – Aug 27 2007 10:18:11:090AM
  • opcao = 10 – 08-27-07
  • opcao = 11 – 07/08/27
  • opcao = 12 – 070827
  • opcao = 13 – 27 Aug 2007 10:22:46:000
  • opcao = 14 – 10:22:54:530
  • opcao = 100 – Aug 27 2007 10:20AM
  • opcao = 101 – 08/27/2007
  • opcao = 102 – 2007.08.27
  • opcao = 103 – 27/08/2007
  • opcao = 104 – 27.08.2007
  • opcao = 105 – 27-08-2007
  • opcao = 106 – 27 Aug 2007
  • opcao = 107 – Aug 27, 2007
  • opcao = 108 – 10:17:36
  • opcao = 109 – Aug 27 2007 10:18:11:090AM
  • opcao = 110 – 08-27-2007
  • opcao = 111 – 2007/08/27
  • opcao = 112 – 20070827
  • opcao = 113 – 27 Aug 2007 10:22:46:000
  • opcao = 114 – 10:22:54:530

Já agora se quisermos que os nomes dos meses e/ou dias da semana apareçam em português (e estivermos com a default language em inglês) teremos que primeiro incluir a instrução set language portuguese

Share

notas leitura: The Mythical Man-Month 1

capitulo 1 – The Tar Pit
pag. 9
“The obsolescence of an implementation must be measured agaisnt other existing implementations, not against unrealized concepts. The challenge and the mission are to find real solutions to real problems on actual schedules with available resources.”

capitulo 2 – The Mythical Man Month
pag. 15
“The programmer builds from pure thought-stuff: concepts and very flexible representation thereof. Because the medium is tractable, we expect few difficulties in implementation; hence our pervasive optimism. Because our ideas are faulty, we have bugs; hence our optimism is unjustified.”
pag. 16
“Men and month are interchangeable commodities only when a task can be partitioned among many workers with no communication among them.”
pag. 21
“Observe that for the programmer, as for the chef, the urgency of the patron may govern the schedule completion of the task, but it cannot govern the actual completion.”
pag. 21
“It is very difficult to make a vigorous, plausible, and jobrisking defense of an estimate that is derived by no quantitative method, supported by little data, and certified chiefly by the hunches of the manager.”
pag. 25
“The number of months of a project depends upon its sequential constraints. The maximum number of men depends upon the number of independent subtasks. From these two quantities one can derive schedules using fewer men and more months. (The only risk is product obsolescence.) One cannot, however, get workable schedules using more men an fewer months. More software products have gone awry for lack of calendar time than for all other causes combined.”

capitulo 3 – The Surgical Team
pag. 30
“… if a 200-man project has 25 managers who are the most competent and experienced programmers, fire the 175 troops and put the managers back to programming. (…) the problem with the small, sharp team concept [is] it is too slow for really big systems.”
pag. 33
“absolutely vital to [Harlan] Mills’s concept is the transformation of programming from ‘private art to public practice’ by making all the computer runs visible to all team members and identifying all programs and data as team property, not private property.”
pag. 35
“Notice in particular the differences between a team of two programmers conventionaly organized and the surgeon-copilot team. First, in the conventional team the partners divide the work, and each is responsible for design and implementation of part of the work. In the surgical team, the surgeon and copilot are each cognizant of all the design and all of the code.”

capitulo 4 – Aristocracy, Democracy, and System Design
pag. 42
“Even though they have not taken centuries to build, most programming systems reflect conceptual disunity far worse than that of cathedrals. Usually this arises not from a serial succession of master designers, but from the separation of design into many tasks done by many men.”
pag. 45
“By the architecture ofa system, I mean the complete and detailed specification of the user interface. For a computer this is the programming manual. For a compiler it is the language manual. For a control program it is the manuals for the language os languages used to invoke its functions. For the entire system it is the union of the manuals a user must consult to do his entire job.”
pag. 46
“Good features and ideas that do not integrate with a system’s basic concepts are best left out.”

capitulo 4 – the second-system effect
pag. 56
“The second-system effect has another manifestation somewhat different from pure functional embellishment. That is a tendendy to refine techniques whose very existence has been made obsolete by changes in basic system assumptions.”


Nome: The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition)
Autor: Frederick P. Brooks
Editora: Addison-Wesley Professional; 2 edition (August 12, 1995)
ISBN-13: 978-0201835953

Share