N-tier and oop - moving across technologies


Published on

A talk on N-tiered architecture, object-oriented programming, and its importance in industry best practices. Presented to graduating college students as part of the Microsoft Philippines Career Booster event.

Published in: Technology, Business
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

N-tier and oop - moving across technologies

  1. 1. N-Tier Architecture & Object-Oriented Programming: Moving Across Technologies<br />Jon Limjap<br />MVP for C#<br />Senior Developer for ITRS<br />
  2. 2. Agenda<br />Shanties vs. Mansions : Housing as an analogy to software development<br />N-Tier Software Application Development<br />Object Oriented Programming<br />SOLID Principles<br />Migrating and integrating apps to new technology<br />
  3. 3. Shanties vs. Mansions<br />Housing as an analogy to Software Development<br />
  4. 4. What do you need to make a shanty?<br />Light materials (e.g., lumber, plywood, GI sheets)<br />Little or no construction skill<br />Little or no electrical skill<br />Do whatever it takes to make things work<br />Creates a shelter you can live in...<br />...but not comfortably so<br />
  5. 5. What do you need tomake a mansion?<br />Heavy-duty materials (e.g., steel, concrete, high quality wood)<br />Architecture: structural plan, electrical plan, plumbing, sewage<br />Carefully chosen materials and furniture<br />Highly skilled carpenters, welders, electricians, plumbers<br />Creates the house of your dreams...<br />...and provides provisions for future development<br />
  6. 6. Put them together, what have you got?<br />Where do you find shanties, where do you find mansions?<br />
  7. 7. Slums<br />Village of shanties built on unutilized and undeveloped land<br />No water lines; deep wells are constructed or water is carried from outside the slum<br />No sewage; waste is either buried, moved to garbage dumps or thrown into rivers or estuaries<br />No proper electrical wiring; electrical cables are strewn across a slum<br />
  8. 8. Slums<br />Lack of infrastructure means health problems, heightened risk of fire and difficulty in moving things and people<br />Also known as “Big Ball of Mud”<br />
  9. 9. Subdivisions<br />Built on prime real estate<br />Well developed infrastructure means easy access to water, electricity, and sewage<br />Planning includes provisions for recreational facilities such as parks, playgrounds, etc.<br />
  10. 10. Subdivisions<br />Efficient structures and services mean happier residents<br />
  11. 11. Are your software applications shanties?<br />Is it composed of a single void Main() with 10,000 lines of code?<br />Does it have one function that does 100 unrelated things? For example: it accesses the database, then manipulates a string, then asks a question from the user?<br />
  12. 12. Are your software applications shanties?<br />When you change one line, do other parts of the program break unpredictably?<br />Do you use copy-paste to add functionality to your code?<br />
  13. 13. Characteristics of good software design<br />How should nicely written software look like?<br />
  14. 14. Characteristics of good software design<br />Minimal complexity <br />designs should be as simple as possible<br />Ease of maintenance <br />code should be easy to read and understand<br />Loose coupling <br />code should have as few dependencies as possible<br />
  15. 15. Characteristics of good software design<br />Extensibility <br />it should be very easy to add new functionality to your design<br />Reusability <br />pieces of code could be reused across one application and even in other applications<br />High fan-in <br />system is designed to have good use of utility code at lower levels<br />
  16. 16. Characteristics of good software design<br />Low fan-out <br />code requires as few external code as possible, as a high number of such indicates complexity<br />Leanness <br />the application should only contain functionalities that it needs to run properly, no more and no less<br />
  17. 17. Characteristics of good software design<br />Stratification <br />design systems which you can view at one level without looking too deep into other levels<br />Standardized <br />code and design should be consistent to increase ease of maintenance<br />
  18. 18. N-Tier Architecture<br />Standard architecture in the software development industry<br />
  19. 19. N-Tier / N-Layer / Multitier<br />Broad term to describe software infrastructure in the software development industry<br />Describes dividing an application solution into "layers"<br />Has a physical and logical components<br />
  20. 20. Physical Layers<br />Describes arrangement of a broad set of tangible and intangible systems<br />May contain one of many components:<br />Application servers<br />Databases<br />Networks (Local/Wide Area/Internet)<br />Services (Web Services, Web APIs)<br />
  21. 21. Logical Layers<br />Describes arrangement of code in a particular software application<br />Typical components:<br />Domain Objects<br />Business Rules<br />Graphical User Interface (GUI)<br />Data Access<br />
  22. 22. How does N-Tier fit into the housing analogy?<br />Physical Layers describe the subdivision – each component describes amenities and facilities in your subdivision<br />Logical Layers describe your mansion – lower layers represent your plumbing and electrical design, while upper layers represent your appliances and furniture and how they all come together to make a great house<br />
  23. 23. Object-Oriented Programming<br />Letting your code describe the real thing<br />
  24. 24. Object-Oriented Programming<br />Software development paradigm wherein the problem is modelled into "objects" -- pieces of code containing data describing an object and the behaviour of such object<br />Objects are defined by "classes". A class contains the definition of the data that an object contains, and its corresponding behaviour<br />Some examples of OO languages: Visual Basic .NET, C++, C#, Java, PHP (starting with version 5)<br />
  25. 25. Key OOP Concepts<br />Class<br />The description of an object in terms of characteristics (attributes) and behaviors (methods)<br />Object<br />The pattern or exemplar being defined<br />Instance<br />An actual object existing at runtime<br />Method<br />Actions that can be performed by an object<br />
  26. 26. Key OOP Concepts<br />Message Passing<br />Objects can invoke other objects’ methods and get their data<br />Encapsulation<br />Details of an object that aren’t needed by other objects are hidden<br />Inheritance<br />Specific objects can be derived from more general objects, retaining all attributes and/or methods<br />Polymorphism<br />The ability to represent an specific object to its more general object<br />
  27. 27. SOLID Principles<br />
  28. 28. Single Responsibility Principle<br />A class should only have one, and only one reason to change<br />
  29. 29. Open Closed Principle<br />You should be able to extend a class’s behaviour without modifying it<br />
  30. 30. Liskov Substitution Principle<br />Derived classes must be substitutable for their base classes<br />
  31. 31. Interface Segregation Principle<br />Make fine grained interfaces that are client specific<br />
  32. 32. Dependency Inversion Principle<br />Depend on abstractions, not on concretions<br />
  33. 33. Migrating and integrating apps to new technology<br />OOP & N-Tier not only makes this easy, it makes it possible<br />
  34. 34. Tons of new technologies came to play in the last 5 years<br />JSON<br />
  35. 35. OOP and N-Tier makes technology change possible<br />Each layer can easily be replaced<br />Integrity of other layers remain<br />Less rework<br />Easier to test<br />
  36. 36. Conclusion<br />We want mansions, not shanties! Subdivisions, not slums!<br />OOP + N-Tier done properly makes it easier to move across platforms and technologies<br />OOP + N-Tier is just one of many approaches in developing software<br />OOP takes years of practice to get right – start now!<br />
  37. 37. References<br />2004: McConnell, Steve: Code Complete 2: Microsoft Publishing<br />1999: Foote Brian and Yoder, Joseph : Big Ball of Mud: http://www.laputan.org/mud/<br />2009: Bailey, Derick: SOLID Development Principles in Motivational Posters: http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx<br />
  38. 38. Your speaker<br />jonlimjap@gmail.com<br />http://dotnet.kapenilattex.com<br />http://msforums.ph/forums<br />http://twitter.com/LaTtEX<br />