The document discusses the importance of game architecture. Good architecture helps with concurrency, maintainability, code ownership, usability and performance, while bad architecture makes systems hard to follow, debug and reuse. It emphasizes principles like stability, reusability and cohesion. Common patterns like object-oriented programming, design patterns, and best practices are also covered. The document stresses that understanding architecture, patterns and best practices is key to a coder and code's survival.
Software project management is the one type of art and science of planning and leading software projects. But its most important to start it in a proper way. In this PPT, we are giving some steps to start it, have a look.
Management of Complexity in System Design of Large IT SolutionsMichael Heiss
The capability to manage complexity is one of the key competencies of system engineers for large IT-solutions. We call a technical system "complex" (in contrast to "complicated") if it is impossible (due to the networked interaction of its components) to predict the behavior of the whole system, even if you know exactly how each of the system components behave. On the other hand, customers expect increasingly high reliability of IT systems as their business is more and more dependent on the proper operation and interoperation of the IT systems. First we show how a network of interactions increases the complexity of the overall-system. Then we analyze the complexity management strategies of our system engineers and present generalized strategies based on examples of large customer projects. The examples demonstrate that a high maturity in managing complexity enables to provide IT solutions of ultra-high reliability even if they are complex solutions in the above defined sense.
No more Three Tier - A path to a better code for Cloud and AzureMarco Parenzan
Three Tier is no more a model for Cloud and in general Scalable Web Applications. Scaffolding from SQL Database is, sure, the worst way to do. A road to do this is changing modeling activity, from scaffolded DB model to Command/DTO model, through ViewModel pattern. Command and DTOs are pillars of CQRS model.
Innoslate is a full lifecycle systems engineering tool that provides you with the capability to perform requirements analysis, functional and physical modeling, simulation, testing, and more all in one place.
Software project management is the one type of art and science of planning and leading software projects. But its most important to start it in a proper way. In this PPT, we are giving some steps to start it, have a look.
Management of Complexity in System Design of Large IT SolutionsMichael Heiss
The capability to manage complexity is one of the key competencies of system engineers for large IT-solutions. We call a technical system "complex" (in contrast to "complicated") if it is impossible (due to the networked interaction of its components) to predict the behavior of the whole system, even if you know exactly how each of the system components behave. On the other hand, customers expect increasingly high reliability of IT systems as their business is more and more dependent on the proper operation and interoperation of the IT systems. First we show how a network of interactions increases the complexity of the overall-system. Then we analyze the complexity management strategies of our system engineers and present generalized strategies based on examples of large customer projects. The examples demonstrate that a high maturity in managing complexity enables to provide IT solutions of ultra-high reliability even if they are complex solutions in the above defined sense.
No more Three Tier - A path to a better code for Cloud and AzureMarco Parenzan
Three Tier is no more a model for Cloud and in general Scalable Web Applications. Scaffolding from SQL Database is, sure, the worst way to do. A road to do this is changing modeling activity, from scaffolded DB model to Command/DTO model, through ViewModel pattern. Command and DTOs are pillars of CQRS model.
Innoslate is a full lifecycle systems engineering tool that provides you with the capability to perform requirements analysis, functional and physical modeling, simulation, testing, and more all in one place.
Lessons learned, sane suggestions, outlook for the future.
A presentation that outlines the kind of challenges that faces whoever has to automate the configuration and the management of an IT infrastructure.
Designing Powerful Web Applications Using AJAX and Other RIAsDave Malouf
This is the slide deck from the workshop given at UI11 on October 9, 2006. This presentation was given with myself (David Malouf) and Bill Scott (AJAX Evangelist @ Yahoo!).
The goal of the course was to teach people the basics of Interaction Design and then how to apply those principles to design using RIA technologies like AJAX and Flash.
Lecture 5 from the COSC 426 Graduate course on Augmented Reality. This lecture talks about AR development tools and interaction styles. Taught by Mark Billinghurst from the HIT Lab NZ at the University of Canterbury. August 9th 2013
Neal Ford Emergent Design And Evolutionary ArchitectureThoughtworks
ThoughtWorks Luminary and Conference Presenter Extraordinaire Neal Ford will be presenting:
Emergent Design & Evolutionary Architecture
Most of the software world has realised that Big Design Up Front (BDUF) doesn’t work well in software. But lots of developers struggle with this notion when it applies to architecture and design, surely you can’t start coding, right? You need some level of understanding before you can start work.
This seminar will explore the current thinking about Emergent Design and Evolutionary Architecture, including:
• Proactive approaches with test driven development
• Reactive approaches including both refactoring and composed methods
• Strategies and techniques for allowing design to emerge from projects as they proceed, keeping your code in sync with the problem domain
• Real world examples of these techniques in action
Neal Ford, Software Architect and Meme Wrangler, ThoughtWorks
Neal is an acclaimed international speaker and expert on designing and building of large-scale enterprise applications. Neal has spoken at over 100 conferences worldwide, delivering more than 600 talks. Neal is also the designer and developer of applications, instructional materials, magazine articles, courseware, video/DVD presentations and author and/or editor of 6 books spanning a variety of technologies, including the most recent The Productive Programmer.
ThoughtWorks Luminary and Conference Presenter Extraordinaire Neal Ford will be presenting:
Emergent Design & Evolutionary Architecture
Most of the software world has realised that Big Design Up Front (BDUF) doesn’t work well in software. But lots of developers struggle with this notion when it applies to architecture and design, surely you can’t start coding, right? You need some level of understanding before you can start work.
This seminar will explore the current thinking about Emergent Design and Evolutionary Architecture, including:
• Proactive approaches with test driven development
• Reactive approaches including both refactoring and composed methods
• Strategies and techniques for allowing design to emerge from projects as they proceed, keeping your code in sync with the problem domain
• Real world examples of these techniques in action
Neal Ford, Software Architect and Meme Wrangler, ThoughtWorks
Neal is an acclaimed international speaker and expert on designing and building of large-scale enterprise applications. Neal has spoken at over 100 conferences worldwide, delivering more than 600 talks. Neal is also the designer and developer of applications, instructional materials, magazine articles, courseware, video/DVD presentations and author and/or editor of 6 books spanning a variety of technologies, including the most recent The Productive Programmer.
Presented as a GrapeCity webinar on May 24, 2017, this presentation describes the need for front-end JavaScript frameworks in modern web development and compares features of the most popular frameworks. Click through the slides to find quick summaries of the most important talking points for each framework along with links to demos, an e-book, and a free download of the Wijmo JavaScript UI library. With front-end web frameworks now more popular than ever, there's never been a better time to start learning!
Your host, Dr. Steven Dam, will show you the ins and outs of the main features and dashboards. He'll provide you with expert tips and tricks as you walk through creating a new account and starting a brand new project for the very first time
This webinar is intended for new Innoslate users.
Basics of Software Architecture for .NET DevelopersDan Douglas
Understanding what Software Architecture is and the benefits of a good architecture along with the implicit requirements that go along with it. The presentation then goes into detail about how the .NET framework can be leveraged as part of a great architecture.
EclipseCon Eu 2015 - Breathe life into your Designer!melbats
You have your shiny new DSL up and running thanks to the Eclipse Modeling Technologies and you built a powerful tooling with graphical modelers, textual syntaxes or dedicated editors to support it. But how can you see what is going on when a model is executed ? Don't you need to simulate your design in some way ? Wouldn't you want to see your editors being animated directly within your modeling environment based on execution traces or simulator results?
The GEMOC Research Project designed a methodology to bring animation and execution analysis to DSLs. The companion technologies required to put this in action are small dedicated components (all open-source) at a "proof of concept" maturity level extending proven components : Sirius, Eclipse Debug, Xtend making such features within the reach of Eclipse based tooling. The general intent regarding those OSS technologies is to leverage them within different contexts and contribute them to Eclipse once proven strong enough. The method covers a large spectrum of use cases from DSLs with a straightforward execution semantic to a combination of different DSLs with concurrent execution semantic. Any tool provider can leverage both the technologies and the method to provide an executable DSL and animated graphical modelers to its users enabling simulation and debugging at an early phase of the design.
This talk presents the approach, the technologies and demonstrate it through an example: providing Eclipse Debug integration and diagram animation capabilities for Arduino Designer (EPL) : setting breakpoints, stepping forward or backward in the execution, inspecting the variables states... We will walk you through the steps required to develop such features, the choices to make and the trade-offs involved. Expects live demos with simulated blinking leds and a virtual cat robot !
Lessons learned, sane suggestions, outlook for the future.
A presentation that outlines the kind of challenges that faces whoever has to automate the configuration and the management of an IT infrastructure.
Designing Powerful Web Applications Using AJAX and Other RIAsDave Malouf
This is the slide deck from the workshop given at UI11 on October 9, 2006. This presentation was given with myself (David Malouf) and Bill Scott (AJAX Evangelist @ Yahoo!).
The goal of the course was to teach people the basics of Interaction Design and then how to apply those principles to design using RIA technologies like AJAX and Flash.
Lecture 5 from the COSC 426 Graduate course on Augmented Reality. This lecture talks about AR development tools and interaction styles. Taught by Mark Billinghurst from the HIT Lab NZ at the University of Canterbury. August 9th 2013
Neal Ford Emergent Design And Evolutionary ArchitectureThoughtworks
ThoughtWorks Luminary and Conference Presenter Extraordinaire Neal Ford will be presenting:
Emergent Design & Evolutionary Architecture
Most of the software world has realised that Big Design Up Front (BDUF) doesn’t work well in software. But lots of developers struggle with this notion when it applies to architecture and design, surely you can’t start coding, right? You need some level of understanding before you can start work.
This seminar will explore the current thinking about Emergent Design and Evolutionary Architecture, including:
• Proactive approaches with test driven development
• Reactive approaches including both refactoring and composed methods
• Strategies and techniques for allowing design to emerge from projects as they proceed, keeping your code in sync with the problem domain
• Real world examples of these techniques in action
Neal Ford, Software Architect and Meme Wrangler, ThoughtWorks
Neal is an acclaimed international speaker and expert on designing and building of large-scale enterprise applications. Neal has spoken at over 100 conferences worldwide, delivering more than 600 talks. Neal is also the designer and developer of applications, instructional materials, magazine articles, courseware, video/DVD presentations and author and/or editor of 6 books spanning a variety of technologies, including the most recent The Productive Programmer.
ThoughtWorks Luminary and Conference Presenter Extraordinaire Neal Ford will be presenting:
Emergent Design & Evolutionary Architecture
Most of the software world has realised that Big Design Up Front (BDUF) doesn’t work well in software. But lots of developers struggle with this notion when it applies to architecture and design, surely you can’t start coding, right? You need some level of understanding before you can start work.
This seminar will explore the current thinking about Emergent Design and Evolutionary Architecture, including:
• Proactive approaches with test driven development
• Reactive approaches including both refactoring and composed methods
• Strategies and techniques for allowing design to emerge from projects as they proceed, keeping your code in sync with the problem domain
• Real world examples of these techniques in action
Neal Ford, Software Architect and Meme Wrangler, ThoughtWorks
Neal is an acclaimed international speaker and expert on designing and building of large-scale enterprise applications. Neal has spoken at over 100 conferences worldwide, delivering more than 600 talks. Neal is also the designer and developer of applications, instructional materials, magazine articles, courseware, video/DVD presentations and author and/or editor of 6 books spanning a variety of technologies, including the most recent The Productive Programmer.
Presented as a GrapeCity webinar on May 24, 2017, this presentation describes the need for front-end JavaScript frameworks in modern web development and compares features of the most popular frameworks. Click through the slides to find quick summaries of the most important talking points for each framework along with links to demos, an e-book, and a free download of the Wijmo JavaScript UI library. With front-end web frameworks now more popular than ever, there's never been a better time to start learning!
Your host, Dr. Steven Dam, will show you the ins and outs of the main features and dashboards. He'll provide you with expert tips and tricks as you walk through creating a new account and starting a brand new project for the very first time
This webinar is intended for new Innoslate users.
Basics of Software Architecture for .NET DevelopersDan Douglas
Understanding what Software Architecture is and the benefits of a good architecture along with the implicit requirements that go along with it. The presentation then goes into detail about how the .NET framework can be leveraged as part of a great architecture.
EclipseCon Eu 2015 - Breathe life into your Designer!melbats
You have your shiny new DSL up and running thanks to the Eclipse Modeling Technologies and you built a powerful tooling with graphical modelers, textual syntaxes or dedicated editors to support it. But how can you see what is going on when a model is executed ? Don't you need to simulate your design in some way ? Wouldn't you want to see your editors being animated directly within your modeling environment based on execution traces or simulator results?
The GEMOC Research Project designed a methodology to bring animation and execution analysis to DSLs. The companion technologies required to put this in action are small dedicated components (all open-source) at a "proof of concept" maturity level extending proven components : Sirius, Eclipse Debug, Xtend making such features within the reach of Eclipse based tooling. The general intent regarding those OSS technologies is to leverage them within different contexts and contribute them to Eclipse once proven strong enough. The method covers a large spectrum of use cases from DSLs with a straightforward execution semantic to a combination of different DSLs with concurrent execution semantic. Any tool provider can leverage both the technologies and the method to provide an executable DSL and animated graphical modelers to its users enabling simulation and debugging at an early phase of the design.
This talk presents the approach, the technologies and demonstrate it through an example: providing Eclipse Debug integration and diagram animation capabilities for Arduino Designer (EPL) : setting breakpoints, stepping forward or backward in the execution, inspecting the variables states... We will walk you through the steps required to develop such features, the choices to make and the trade-offs involved. Expects live demos with simulated blinking leds and a virtual cat robot !
Belajar dasar-dasar bahasa mandarin untuk percakapan (bagian 2) di restoran.
Slide ini merupakan perangkat ajar untuk Pelajaran Bahasa Mandarin Paket C - Taiwan.
Disunting oleh: Hadziq Fabroyir 哈明飛
Belajar dasar-dasar bahasa mandarin untuk percakapan (bagian 1).
Slide ini merupakan perangkat ajar untuk Pelajaran Bahasa Mandarin Paket C - Taiwan.
Disunting oleh: Hadziq Fabroyir 哈明飛
This slide elaborates how to inquiry courses and select courses at National Taiwan University of Science and Technology (NTUST). All the things are done online.
Terinspirasi dari presentasi Randy Pausch (Profesor dari Carnegie Mellon University) tentang Time Management.
Slide dapat diunduh sebagai dokumen PDF yang telah dilengkapi "Presentation Notes" di pojok kiri masing-masing slide.
Tulisan di dalamnya campuran bahasa Indonesia dan Inggris . :]
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
2. Taken from the Presentation slide of :
Jeff Ward
Associate Programmer
Bethesda Game Studios
[ Wijanarko Sukma . Department of Informatics ]
3. How can architecture help us :
Concurrency
Maintainability
Code Ownership
Usability
Performance
Stability
Architecture
[ Wijanarko Sukma . Department of Informatics ]
4. Bad architecture creates problems
Produces side effects
Hard to follow
Hard to debug
Hard to reuse
Spend more time finding a way around the
architecture than fixing the problem
OMG HAX!
Bad Architecture
[ Wijanarko Sukma . Department of Informatics ]
10. “Encapsulation is a programming mechanism that
binds together code and the data it manipulates, and
that keeps both safe from outside interference and
misuse.” – Schildt
Encapsulation is not just data hiding!
Implies each object should be a cohesive whole
Encapsulation
[ Wijanarko Sukma . Department of Informatics ]
11. Accessing elements between instances
It’s a convenience feature, not a good idea
“Always Design for Concurrency” – Tip 41 in The
Pragmatic Programmer
Even if you don’t need it, a cleaner architecture results.
Instance Encapsulation
[ Wijanarko Sukma . Department of Informatics ]
Creature Creature
12. Key overused concept of OOP
“ Inherit not to reuse, but to be reused.”
“Is a” vs. “has a” vs. “needs to used as a”
Degrades performance
Prefer components over inheritance
Cleaner architecture
Faster execution time and overhead
More flexibility
More encapsulated
Inheritance
[ Wijanarko Sukma . Department of Informatics ]
13. Important as it relates to inheritance…
Just realize that polymorphism goes two ways
Readable
Unreadable
Polymorphism
[ Wijanarko Sukma . Department of Informatics ]
14. Book Design Patterns by “The Gang of Four” (Gamma
Helm Johnson Vlissides)
The same problems keep coming up in CS
We keep solving them in the same (or similar) ways.
Is there a pattern here?
Intro to Design Patterns
[ Wijanarko Sukma . Department of Informatics ]
15. Creational pattern
Only one instance of the object exists
Private constructor with public accessor (usually
Class::Instance())
Really nice name for a global
Often overused, and often not a real solution
Singletons translate well to factories
Singleton
Or “Patterns Don’t Solve all Problems”
[ Wijanarko Sukma . Department of Informatics ]
16. Singletons (or factories) welcome…
Renderers
Resource managers
Memory managers
Message queues
Singleton Example
[ Wijanarko Sukma . Department of Informatics ]
17. Behavioral pattern
Inform multiple dependant objects of changes
Usually implemented as Subject and IListener objects
Listeners add themselves to subjects
When a subject changes, all listeners are notified.
Great for message queues
Observer / Listener
[ Wijanarko Sukma . Department of Informatics ]
18. Architectural pattern
Keeps data and representation separate
Model = data, view = representation
Controller is what sends messages to the model and
view.
Advantages
One data, multiple views
Data manipulates data, and doesn’t care if its being viewed
Change renderers without changing anything else
MVC
Model View Controller
[ Wijanarko Sukma . Department of Informatics ]
19. Separate view from everything else
MVC Example
[ Wijanarko Sukma . Department of Informatics ]
Renderer
3DObj
Creature
Vs.
Creature Model
CreatureView
Renderer
3DObj
CreatureRadarView
20. Complete decoupling of logic from display
Easier to test, since you can watch just the logic
Easier to change (both the display and the logic)
Can run the view without the logic
Can run the logic without the view
Can distribute the logic
So long as instances are encapsulated
Advantages of MVC
[ Wijanarko Sukma . Department of Informatics ]
21. Command
An object that represents stuff that should be done, as
an object
Only needs to understand “Execute” and “Undo”
Great for input handlers, macros, and undoable
operations
Façade
Encapsulate an entire system by providing a single
coherent interface
Proxy
A stand in for a concrete object.
Other Quick Patterns
[ Wijanarko Sukma . Department of Informatics ]
22. Management idea
That there is a technique that is more effective than
any other technique at delivering positive results.
Something you don’t have to do, but it’s a good idea.
They’re like design patterns on a small scale.
Best Practices
[ Wijanarko Sukma . Department of Informatics ]
23. Management Best Practices
Use version control
Do automated testing
Have automated builds
Coding Best Practices
Prefer compile / link time errors to run time errors
Give one entity one cohesive responsibility
Prefer composition to inheritance
Always code for concurrency (in terms of architecture)
Examples of Best
Practices
[ Wijanarko Sukma . Department of Informatics ]
24. Best Practices
Are key to your survival as a coder…
… and key to your code’s survival
[ Wijanarko Sukma . Department of Informatics ]
25. Know what you’re doing and why.
Know that one approach to inheritance is better and know
why.
Know when you’re coupling systems inadvertently
Know when you’re coupling instances
Know when to test
Know how to test
Know when to automate
Some Advices
[ Wijanarko Sukma . Department of Informatics ]
26. Know when to refactor
Know when to rearchitect
Know that both are going to break everything
Final Words
[ Wijanarko Sukma . Department of Informatics ]
27. Game Dev lecturers team
By Wijanarko Sukma (5105100173)
[ Wijanarko Sukma . Department of Informatics ]
Editor's Notes
Bad architectures create problems, and often you will end up solving the wrong problem in order to work around the architecture.
Why is this?
Bad architecture can produce a lot of side affects. Code that affects lots of systems synchronously can sometimes do really weird things you weren’t expecting, causing hard to trace bugs.
Bad architectures are hard to follow, especially when you’re not stepping through the code because you don’t necessarily know what will call what, or what side effects will occur based on a single function call.
As a result, bad architectures are hard to debug. There’s lots of things to step into and trace before you can find the root of the problem.
Bad architectures are also very hard to reuse, since ripping out any one given system to use somewhere else (or replace in the current game) can cause a very large number of side effects
Generally, near the end of projects you will spend more time debugging and trying to find a way around the architecture in order to fix an issue than you will actually fixing the issue. And even then your fix may not actually solve the problem, or may create more.
Known as the OMG HAX syndrome.
Fortunately, following the principles of OOP will improve the mess
We’re going to spend a bit of time talking about some of the principles of OOP you probably take for granted
Though not principles of OOP, principles of good design will also help us create a well architected engine.
Coupling is the degree to which modules rely on each other
The $10 word here is ortogonality, which isn’t actually a word
“is a system design property which facilitates the making of complex designs feasible and compact “ - Wikipedia
Encapsulation is a principle we take for granted
Remember that encapsulation is not just data hiding, though they are closely related. It means that data, and the processes to edit that data are kept together.
Encapsulation implies that an object should be a cohesive whole
Which also means that it should do one thing and ONLY one thing.
Any modification from classes outside itself increases coupling, and introduces side effects
It also implies that instances of the same class should not edit each others
Encapsulation should also be applied between instances
By editing the state of an object outside it’s own scope, you can introduce a layer of hidden coupling, not necessarily between systems but between objects in the same systems, and between instances of the same object
This may not sound bad, but it can produce some seriously mean side effects as you move forward with developing your engine.
It also makes concurrency harder, since editing instances of the same objects means they can’t be parallelized.
You always want to design for concurrency.
Which means objects should always be in a valid state before and after a function call.
Instances should always edit each other through function calls, or better, message passing, which we’ll get to.
Inheritance is frequently overused.
It tightly couples the child to the parent, and all things that use the child to the parent. It’s often an invisible form of coupling you don’t want.
It is usually used to reuse code, a place where it is usually not welcome.
Inheriting to reuse code usually means you’re actually looking at a containment relationship. A “has a” relationship if you will.
But it is important to understand inheritance should only be used not where you want to reuse code, but where an object needs to be reused under difference circumstances.
Interfaces are probably the best example of this
Frequently told inheritance is an “is a” relationship. That if something “is” something else, than you’re looking at inheritance. This is not necessarily true.
If something “is” something else, but will never be used like that something else, there is no reason to inherit.
So we run into the “is a” vs. “has a” vs. “needs to be used as a” relationship. Know which one you’re working with.
Anthoer way to think of it is “Extends the functionality of…”
But remember, you may not need all of the functionality of the base class, so make sure you’re using it under the right circumstances.
Remember, large inheritance degrades performance silently, and other architectures can do similar things with less overhead, and more flexibility
Components are my personal favorite.
Flexibility is offered in that you can always add random components (at compile time or at run time) to any class you want.
In the last point, we can protect and control the data of a single component far easier than we can on a class with an inheritance tree.
Changes can be made at any point in the tree, which makes things difficult
Although components are my personal favorite, you’ll find they don’t solve all problems. Remember, there are no magic bullets.
This is a best practice (which we’ll get to) not a steadfast rule. Use the rules where you think they’re needed, just be careful you’re not overusing anything.
Polymorphism probably doesn’t deserve it’s own slide. It’s an important concept to OOP, especially as it relates to inheritance, but not hugely important to this architecture talk, which is more about relationships between classes.
There are two ways polymorphism can go.
Readable. For example math operations on matricides that can take integers, floats, and other matricies.
Unreadable. For example Damage functions on your creatures that can take both Creatures and Bullets. (well if the player shot the bullet, which one do I use again?)
How many people have heard of design patterns?
How many people can name a few?
Singleton, Factory, Façade, Proxy, Model / View / Controller, Iterator, Command, Observer / Listener, Chain of Responsibility
Singleton is a favorite, and it’s where we’ll start
Creational pattern (meaning it describes how an object gets created)
Usually Instance() will create the object if it doesn’t exist, and holds onto it via a static member pointer
A singleton is usually being used as a global, and globals wreak havoc on encapsulation and concurrency
But if you’re working with a single instance of something that isn’t easily contained in another class, a singleton is better than a global for various reasons, including their portability into factories
1 instance per thread constructions
Swapping constructions (get an instance that is currently viable)
Control whether instances can be allocated
Always avoid the “static class” a class where all members are static. These are just bad ideas, since they’re so hard to change
Behavioral pattern means it changes the way things behave (other examples are Command and Chain of Responsibility)
Already you can see reduced coupling because the subject doesn’t need to know what the subjects are, or where they are, or even if they exist at all.
Furthermore, listeners don’t need to even know what subject they’re listening to, just that they’ll be informed if they need to change.
Not in Design Patterns
Probably my favorite pattern, since it illustrates a key point in design: Data and representation of that data are separate.
Examples
CSS in web development
Code behinds in ASP.NET and XAML
The idea here is to completely separate the visual identity of the creature from its thought process
(It has an image problem)
Also, you make sure the view is only asking the model for data, not the other way around.
The model shouldn’t care what is happening in renderer land
The second may look more complicated, but it has advantages.
We can add more views of the same model, which is an easy way to do radar systems and maps.
We can completely remove the view and have a completely working AI system, which can think either off screen, or even on a separate computer, without ever being rendered.
For more information, read Design Patterns
Command is probably the one I use most of these three.
Allows you to easily support macros (see the composite pattern) as well as undo opperations
They’re great for input handlers (bind keys to command creation functions via a map) as well as for any undoable operation.
The others are included just because you might want to sound smart one day.
Best practices are a management idea (but we won’t hold that against it)
It’s the idea that there is a way of doing things that will produce the results you want faster and more efficiently than other methods of doing the same thing.
For programmers, it’s something that’s not standardized (or written in the coding standards of your company) but following it tends to lead to good code, well architected systems, and things that are easy to change without side effects.
Basically, you don’t have to do these, but they tend to be good ideas.
They’re like design patterns in that, people found that certain practices led to bad results, and that doing things in a certain way would keep these things from happening.
I recommend two books on the subject
These are my personal favorites, but there are others including Effective C++, Effective C#, Effective STL, etc.
Know when to refactor.
Refactoring is a general term for taking the same functionality and making it better. This includes redesigns and simple changes to pull out common code into funciton calls.
If functions or classes are becoming monolithic, it’s time to think about where things may be split up.
Refactoring doesn’t necessarily change the external interface, but the internal workings
Know when to rearchitect
Rearchitecting is technically refactoring, but in my mind, it’s going back to the drawing board because things just aren’t working right
If you can, rearchitecting should be done in stages, so you’re always left with working code.
Both refactoring and rearchitecting are there to improve your engine, but they’ll break lots of things along the way.
They will ALWAYS break things along the way.
Get into the habit of the TDD cycle (even if you’re not doing TDD).
Always make sure your previous functionality is still working before moving on.