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