Free Windows Azure Bootcamp in Makati on 3-29-2014

Global Windows Azure Bootcamp v.2

Welcome to Global Windows Azure Bootcamp! On Saturday, March 29, 2014 we are out to make some records!

In April of 2013 we held the first Global Windows Azure Bootcamp at more than 90 locations around the globe! This year Azure Pilipinas offers up a one day deep dive class to help thousands of people get up to speed on developing Cloud Computing Applications for Windows Azure. In addition to this great learning opportunity the hands on labs will feature pooling a huge global compute farm to perform research for charity!

Windows Azure Release Notification – 13 August

Windows Azure Release Notification – 13 August

This morning Microsoft released some great updates to Windows Azure.  These new capabilities include:

  • SQL Server AlwaysOn SupportGeneral Availability support with Windows Azure Virtual Machines for High Availability and Disaster Recovery
  • Notification Hubs: General Availability Release of Windows Azure Notification Hubs (broadcast push notifications for Windows 8, Windows Phone, iOS and Android)
  • AutoScale: Schedule-based AutoScale rules and richer logging support
  • Virtual Machines: Load Balancer Configuration and Management
  • Management Services: New Portal Extension for Operation logs + Alerts

I shared the link above posted by Scott that details this improvements.

Back to Basics: OOP and Layered Application Design (Fundamentals to N-Tiered Architecture)

After doing an introduction to basic OOP Principles,

  1. Classes and Objects
  2. Inheritance
  3. Polymorphism (in Taglish)
  4. Encapsulation (also in Taglish, mostly in Filipino)

I am moving the series further to discuss another programming basic which is building an application with its components separated by logical layers. This principle will also serve to be a foundation for writing Tiered Solutions when I get later to the series.

While there have been a lot of enhancements to the .NET Framework since I first wrote about this subject in 2005 or 2006, principle remains the same and I will be writing similarly because previous statistics revealed that those were the most read portions of my blog. There must also have clarity in how that was written so I elected to put the same approach.

To give a brief background, the process of layering is done to group similar program functions into a component for good uses such as flexibility, code readability, and separation of concerns to name a few. Below is an example of a high level diagram of the most common approach.

Where

Presentation Layer provides users with interaction to business functions and processes through its presentation processing logics. Most often in the form of a Web Site Application, Windows Based Applications, and Device Specific Implementations such as ATMs, Tablets, Smart phones, etc.

Business Layer exposes the core functionality of software either by a library or web services exposed to the consuming presentation tier. In practice, program functions are usually encapsulated to a business logic code. It can sometimes contain components that integrate other application components such as a job or a trigger to a Windows Service, depending on your requirements, in other instances; those reside directly from the presentation layer or downstream to the Data Layer.

Data layer provides access to data hosted within the boundaries of the system, a custom data processing logic and data exposed by other networked systems; perhaps accessed through services. The data layer exposes generic interfaces that the components in the business layer can consume.

There are other layers that are considered to be reused across other tiers or on a specific function. Examples are Security, Interfaces, and Helpers some of which we will use the next set of articles.

To kick start the series, let us prep the solution we will be using to get more sense into the diagram I have showed earlier. Open up Visual Studio (or an Express Edition variant such as for Desktop or for Web).

Create a solution with projects (and corresponding project types) listed below. If you have been into the previous articles, we are going to be writing a fictitious Grading system so my students from the previous articles can easily follow.

  1. Grading.Interfaces (Class Library Project)
  2. Grading.Helpers (Class Library Project)
  3. Grading.DataAccess (Class Library Project)
  4. Grading.Business (Class Library Project)
  5. Grading.Services (although a little more advance, but this will showcase another programming principle that is more becoming common especially in the cloud era).
  6. Grading.WebUI (for Web) or Grading.WinUI (for Desktop)

In this set of exercises, we will be using my favorite database management system which is SQL Server (you may use the express variants).

Watch out as we continue this series.

———————————–

Filipino translation:

Para sa pagpapatuloy ng sinimulan kong serye na tumalakay sa ilang importanteng disiplina ng OOP, ang mga susunod na panulat ay tatalakay ng isa pang programming basic kung saan pinapaliwanag ang pagbuo ng isang application gamit ang paghihiwalay ng mga lohikal na mga bahagi. Ang prinsipyo na ito ay magsisilbi rin na pundasyon para sa pagsusulat ng Tiered Solutions sa mga susunod pang mga serye.

Kahit nagkaroon na ng maraming bago sa .NET Framework mula ng una kong naisulat ang tungkol sa paksang ito noong 2005 o 2006, ang mga prinsipyo ay nananatiling pareho. Sang-ayon din sa inilarawan ng istatistika na ang bahagi ng aking blog na may kinalaman dito ang may pinaka-maraming pagbasa kaya pananatilihin ko ang parehas na istilo.

Para magbigay ng maiksing salaysay, ang proseso ng paghihiwahiwalay ng mga bahagi ng programa ay upang makapag-bigay na mas angkop na pag-pangkat ng code upang mas madaling mabasa at makapagbigay ng mas malayang paggamit. Ang larawan sa itaas ay isang halimbawa ng isang mataas na antas ng nagpapakita ng isa sa pinaka-karaniwang diskarte.

(larawan)

Kung saan

Presentation Layer ay nagbibigay ng pakikipag-ugnayan sa mga gumagamit at kung ano ang kayang gawin ng programa sa pamamagitan ng Web Site Application, Windows Based Applications, at Device Specific Implementations katulad ng isang ATM, Tablets, Smart phones, at iba pa.

Business Layer ay naglalantad ng pangunahin at serbisyo na kayang ipamalas ng isang programa na nagbibigay ng karaniwang gamit para sa Web Site o iba pang nasa Presentation Layer. Madalas ay itinatago nito ang mga proseso na hindi kailangang ipakita sa mga taga konsumo nito.

Data layer naman ay nagbibigay ng access sa data o impormasyon na naka-host sa loob ng mga hangganan ng sistema.

May mga iba pang mga layer na itinuturing na reused sa kabuuan ng iba pang mga Tier o sa isang tiyak na function. Mga halimbawa nito ay Security, Interface, at Helpers; ang ilan sa mga ito ay gagamitin sa susunod na hanay ng mga artikulo.

Ang gagamitin nating database management system ay SQL Server.

Read IT, love IT, live IT! J

Back to Basics: OOP and C# (Encapsulation) – Taglish

Ito ay ika-apat sa isang serye ng mga panulat tungkol sa Object Oriented Programming at C# at pangalawa na isinulat sa wikang Filipino at English. Sa unang bahagi, aking tinalakay ang Classes at Objects, sinundan ng Inheritance, at ito lamang nakaraan ay Polymorphism. Kung susundan mo sa unang bahagi, doon mo mapupuna ang mga ginamit na halimbawa ay nagpapakita na ng ilang pag-gamit ng Encapsulation na siyang paksa ng panulat na ito.

Sa MSDN, ito ay pinaliwanag na ganito:

“Naayon sa prinsipyo ng encapsulation, ang isang class o struct ay ang maglalarawan kung papaano mo nais magamit ang mga bahagi nito sa labas ng class o struct kung saan mo ito idiniklara.” Idinagdag pa dito na “Ano mang method at variable na hindi mo nais ipakita sa labas ng class o assembly ay maaari mo ring itago sa pamamagitan ng Encapsulation upang malimitahan ang hindi maayos na gamit.”

Ang nabanggit na Members
(o bahagi) sa itaas ay ang mga sumusunod:

Paalala: Ang bawat isa sa nabanggit ay link papunta sa kanilang kahulugan sa MSDN.

Ang mga Access Modifiers ang makapagsasabi kung ang ilan sa mga Members (o bahagi) na nabanggit ay maaring gamitin sa labas ng class o sa sarili loob lamang ng class kung saan ito naidiklara. Ang ginagamit sa salita upang maglarawan nito ay public, protected, internal, protected internal, at
private.

Upang ipakita ang isang halimbawa, balikan natin ang isang class na ating binuo (assuming na sinundan mo ang pagsulat nito sa unang tatlong bahagi ng serye):

Makikita natin dito na ang lahat ng miyembro ng class ay nakadiklara na public. Ito ay naglalarawan na ang sinumang gumamit ng class na ito, o gumamit ng assembly kung saan kabilang ang class na ito ay pwedeng gamitin sa kanilang code ang Grades, UpdateGrade at NameLastFirst.

Ilang bagay ang ating gagawin upang ipahiwatig ang intensiyon na ilarawan ang encapsulation na nababagay sa halimba sa itaas.

Una: dahil ang ‘Grades’ na property ay hindi natin nais ipagamit ng diretso, gagawin natin itong private;

Pangalawa: upang magamit ang ‘UpdateGrade’ sa derived classes at hindi sa iba pa, papalitan natin ang access modifier nito ng protected.

Pangatlo: ang pagpapakita ng laman ng Grades na koleksiyon sa parehas na assembly at derived classes ay maaring makamit sa pamamagitan ng protected internal.

Tingnan ang halimbawa sa ilalim:

Sa bagong halimbawa, hindi na makikita ang Grades at UpdateGrade kung ang class ay tatawagin sa isang instance.

Subalit maari paring makita sa isang derived class ang UpdateGrade, pero hindi ang Grades. Halimbawa:

At ang kalalabasan nito sa ating programa kapag pinatakbo ay:

read it, love it, live it!

Back to Basics: OOP and C# – Part 3 (Polymorphism)

In Part 2, we went into the definition of Inheritance and have shown example of it’s implementation. This week, we’ll be covering one of the OOP Principles that I mentioned in previous posts which is polymorphism.

Also, I realized that there had been a lot of great tutorials in the web already, and since I am delivering this to the Sophomore Class I will be teaching to in a couple of days, I decided to do this a little differently. I am going to ‘experiment’ and mixed some local dialects to it so it would be better understood here in the Philippines (a.k.a. TaglishTagalog/English).

Kung titingnan nyo yung nakaraang posts, makikita nyo dun yung project na ginamit at itutuloy lang natin dito. Pero bago yun, ibigay muna natin yung kahulugan ng Polymorphism sa Taglish:

Mula sa MSDN:

Polymorphism is a Greek word that means “many-shaped” and it has two distinct aspects:

  1. At run time, objects of a derived class may be treated as objects of a base class in places such as method parameters and collections or arrays. When this occurs, the object’s declared type is no longer identical to its run-time type.
  2. Base classes may define and implement virtual methods, and derived classes can override them, which means they provide their own definition and implementation. At run-time, when client code calls the method, the CLR looks up the run-time type of the object, and invokes that override of the virtual method. Thus in your source code you can call a method on a base class, and cause a derived class’s version of the method to be executed.

Ang sabi dito, yung mga objects sa derived class, ay pwedeng ituring na bahagi ng base class sa loob ng method parameters, collections, o sa mga arrays kapag pinatakbo yung program. Pag nangyari yun, iba na yung type ng object sa declaration kumpara kapag pinatakbo mo na sya. Halimbawa (pansinin nyo na itutuloy lang natin yung nakaraang project):

Buksan nyo yung Instructor class, tapos dagdagan nyo ng isang virtual method. (Yun pa yung isang konsepto nya, kapag gumawa ka ng virtual method sa base class, naka deklara na yung pangalan nya at implementasyon, pero pwede mong gamitin yung pangalan sa derived class at magbigay ng panibagong implementasyon (gamit yung override).

Overridable virtual method

Overridable virtual method

Ayun, tapos magdagdag tayo ng tatlo pang derived class na gamit yung Instructor bilang base class. Halimbawa:

Override method on derived class

Override method on derived class

Pansinin nyo, kakalagay ko palang nung override na pangalan tapos lumabas na kaagad na rekomendasyon sa intellisense yung Teach na method.

Ayun, kapag nilagay natin yung kumpleto (pinagsama ko nalang sa isang file yung tatlong class):

Derrived classes with Teach method

Derived classes with Teach method

Ngayon, ilagay naman natin sya sa main program para masubukan natin kung paano sya tatawagin… ang intention nito ay para maipakita na pwedeng magamit yung Programming, SoftwareDesign, at DatabaseDesign kahit saan na ginamit yung Instructor. Hindi narin natin kailangang mag cast sa tamang type kasi kakayanan ng gawin yun nung paggamit ng base class papuntang derived class.

Polymorphism at work

Polymorphism at work

Ang isa pang mapupuna natin sa halimbawa ay yung pagtawag sa method na Teach, na ang implementasyon nila ay hango sa derived class, pero nilagay din nating halimbawa yung pagtawag sa base method ng Teach dun sa Programming class, kaya parehas natin makikita sa resulta yung ginawa ng Teach sa base class at Teach pag tumakbo na yung sa linya ng Programming na class

Polymorphism at runtime

Polymorphism at runtime

Sya nga pala, yung ‘var’ na nakikita nyo, pag-compile nyan, Instructor din na type ang kalalabasan nyan. Kung sinadya ko sya sa code, ganito lang din sya — foreach (Instructor subject in teaches) — malinaw na ba? I hope this work well for you, hanggang sa muli!   (just realized that this is the only Taglish part, and most of it were in Tagalog, hahe) read it, love it, live it 🙂

SQLSaturday Manila, Philippines 2013

SQLSaturday Manila, Philippines 2013

The Philippine SQL Server User Group is excited to bring SQLSaturday to Manila, Philippines.

SQLSaturday is a training event for SQL Server professionals and those wanting to learn about SQL Server. This event will be held Nov  9 2013  at Microsoft Philippines, 8th Floor 6750 Ayala Tower, Makati City, NCR, Philippines. Admittance to this event is free, all costs are covered by donations and sponsorships. Please register soon as seating is limited, and let friends and colleagues know about the event.