Patterns for Extensibility

Video in TIB AV-Portal: Patterns for Extensibility

Formal Metadata

Patterns for Extensibility
Title of Series
Part Number
Number of Parts
CC Attribution - ShareAlike 4.0 International:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this license.
Release Date

Content Metadata

Subject Area
How can I make my Django app extensible so it can be used beyond my original intent and gain wider adoption? Come learn how Eldarion has been making their apps extensible for greater reuse as well as wider adoption.
Computer animation Multiplication sign Software developer Projective plane Core dump Water vapor
Point (geometry) Open source Channel capacity Gender Multiplication sign System administrator View (database) Projective plane Cognition Field extension Hooking Different (Kate Ryan album) Term (mathematics) Statement (computer science) Figurate number Social class
Functional (mathematics) Mobile app Length Gender View (database) Set (mathematics) Client (computing) Usability Web application Sign (mathematics) Term (mathematics) Password Energy level Website Plug-in (computing) Social class
Implementation Context awareness Hoax Service (economics) Code Set (mathematics) Client (computing) Template (C++) Subset Field extension Energy level Proxy server Social class Module (mathematics) Default (computer science) Email Block (periodic table) Gender Content (media) Instance (computer science) Cartesian coordinate system Computer animation Personal digital assistant Website Right angle Object (grammar)
Category of being Default (computer science) Sign (mathematics) Code Block (periodic table) Gender Set (mathematics) Endliche Modelltheorie Client (computing) System call Social class
Latent heat Sign (mathematics) Process (computing) Computer animation View (database) Password Client (computing) Spacetime
Slide rule Validity (statistics) Gender Bit Rule of inference Code Latent heat Sign (mathematics) Computer animation Profil (magazine) Password Operator (mathematics) Cuboid Form (programming)
Complex (psychology) View (database) Mereology Code Rule of inference Field (computer science) Sign (mathematics) Mathematics Information security Plug-in (computing) Form (programming) Module (mathematics) Addition Dependent and independent variables Email Key (cryptography) Gender Software developer Projective plane Price index Process (computing) Computer animation Password Mixed reality Network topology Website Right angle Metric system
Befehlsprozessor Computer animation Source code Right angle Metric system Mereology
Axiom of choice Building INTEGRAL Tap (transformer) 1 (number) Client (computing) Image registration Mereology Hypermedia Single-precision floating-point format Endliche Modelltheorie Physical system Social class Software developer Structural load Instance (computer science) Flow separation Process (computing) Internet service provider Order (biology) output Website Figurate number Metric system Surjective function Point (geometry) Windows Registry Mobile app Implementation Functional (mathematics) Open source Token ring Root Plug-in (computing) Module (mathematics) Dependent and independent variables Inheritance (object-oriented programming) Forcing (mathematics) Interface (computing) Projective plane Cartesian coordinate system Word Kernel (computing) Loop (music) Computer animation Personal digital assistant Network topology Object (grammar) Abstraction
Computer animation Student's t-test
at the time it was a kind of the the the so in the water is that the and my name is practical the the of engineering adultery and core developer on the next project well the real have it so there's
currently over 60 open source projects in the next you ecosystem this morning I like to discuss how we got extensibility many and I cannot figure out how to make these things the it's been doing
some and so why should you care about extensibility the once the foundation of reusability when we're writing Django apps we want them to be reusable 2nd we have a chance to the lighter users we've all experienced this I know that I have on gender is a great example of this whether it's spinning admin using class these views custom used you use and customers among and lastly we have a chance to make the world a better place and those up pretty grandiose statement but really if we reduce the need to reinvent the wheel we increase the time in cognitive capacity that is available to spend working on new and interesting problems the community benefits becomes more productive and more innovative the resulting in more value creation for in the world around us just how we go about creating extensibility the there's a lot of different ways but I wanna focus just on 3 today the 1st this is what we call hook sense and this is a term on point by the
term coined by Brown Roger be created of sets in gender user accounts interest was was driven by the client need where the user signals didn't quite support the requirement on the least not as clean as we like and was simply simply class with methods that can be overridden the site level and we have a class these views trust of the gain discusses at length on Tuesday and the great way to modify and extend behavior of an app inside site and lastly plug-ins plug-ins instrument loose coupling between the plug-in consumer they allow for rapid expansion of functionality due to the ease of writing individual audience and the used mostly to extend extend the single out or website less about readability so user accounts is
probably 1 of Bulgaria's most used apps antenna provides a ton of functionality that we've all come to expect from Web applications things like sign of quality and you know confirmation password reset even more a lot of these rely heavily on singing e-mails the up until Hooke's sets so we're really only able to
modify I the of those looks that's we
really only able to modify that the content of the e-mail templates and not really change how the most consent the client's case 1 to control the content of the e-mail through a third-party website third-party service that it's right to and it would require us to make API calls provided content context for those e-mails so the solution was to create a hoax set method in on books methods to override all e-mails are being set so we could implement this site false take a look at some code to make these plants so for the full extent implementation ships was gender user accounts basically just pulled out all of the of blocks of sending e-mail into individual methods in this in this object in this class and we have looked so proxy and we use this subset object the instance of looks that proxy to wrap the pooling of the settings in that setting is what allows us to override the default sets would create a hoax that their application on our website that allows us to override how the most work on so here in our cough module so you can see we use young levels else you at for application settings that's a fantastic way to to encapsulate all the settings reusable out highly recommended on the we ship with
of the fall upset configured as you see here in this looks property of the cotton cough model on but to override it is the simplest and thinking of creating your own class at the inherited from the base Cook said and done but in it is somewhere in the site and and setting the account books that said in in the sentence that I the the here in the models of the generative using gender user accounts on you can see in this sign up the class the sign of model we have a method called sand and used to be a block of you typical sendmail of code here and that was replaced with this looks at our method segmentation him and that's what keeps it that's what allows us to override how the most sets for the client we doctors making API calls and replacing the default so
we're gonna space views with a client specific needs for sign up for the final process as well as complexity of
passwords so the the I really
polydispersities slides this on anyways the need to declined needed support for profile operation and coupon codes right upon upon sign up and passwords that's very specific business rules like contains certain characters and were not that other box are really supported by gender user accounts so we had to extended the sign of you and override similar forms on commodified and to collect and processes such today but we don't wanna rewrite have to rewrite the entire sign up you and the forms that dealt with the passwords following really needed do was a little bit of extra validation
the to like it's going back yeah so as you
see here in view this is the views module of the project we're pulling on the sign of you from gender user accounts subclass and overriding just a few methods of to deal with user creation and 1 on this cold it's after sign method that gives us access to the form and we use that to basically take that created user pretty profile process and the coupon codes In addition were pulling and the custom signed form from node that has the password secure password mix and that will see here and really all we needed to do to change these 3 forms that deal with the the
deal with the passwords is to create exam on to encapsulate in 1 place the business rules that had that were around the validating the password was the past we had was up to this complexity requirements and makes it with the other 3 forms what really changing any of the the forms on themselves except for the sign form obviously at some additional fields there on new title together and the Urals so we override routs provided by D. by Jane user accounts on for the part change password password reset views for using start use but were pulling were Bagrow right in here so we can use to custody forms that we over and of course using our custom sign you the in now and plug-ins so eldering as of is really an early development KPI tree it's a tool for teams track metrics scorecards and key performance indicators quarter this fact is collecting metrics some of this is some of this will be manual and there's a lot of metrics on you some of this is manual like you know will will come to the site and I thought of former respond to an e-mail but there's a lot of matches the generated from systems and so it makes sense to automate the collection of those ge about through my
computer processor the and so yes
so for the automated metrics so we want a way to easily right source part
days there's personal from last nite the for any of your person as it doesn't automatically but then in this but but I believe I was talking about the other nations and so we need a way to easily write integrations for the automated collections on will and Bly cleaner gradable these but wanted expose the ability for anyone to contribute and add to them the root open-source package onto people can that the own and you know to encourage this we need to be dead simple this nothing new no sites like its centuries offer this on get held in Singapore quest of you know it's still play the idea is you should only have implement a single class to conform and conform to a DPI not afterward I knew the internals of the whole system and so this really just 2 parts here that object make this plugin system work on the 1st is the 1st is a registry which is really just a of a small wrap around a dictionary and you see here we create an instance and then deleted crater singleton and important point of reference in about point the important point here is on this registry object as a single point of interface between the the internals of the website and the points and the 2nd half of this based got module that implement this whole plugin system or as a base plug in class someone who's would be an abstract base class but on 4 and a note here you can see it has this thing called a metaclass on which is this registrable class part and the really cool thing about this is in the definition of a any to the definition of a new plugin will automatically register itself it's 1 less thing to worry about it figuration on our side or for the developers to have to get right and so here's an example plug-in that I wrote for and 4 are used and we use it to integrate with user voice specifically to pull and sport metrics from Don I don't know this is about all there is to implement plug-in on obviously have cut out the implementation details the unimportant and flight so but some on of the ideas you just implement the these methods to interact with in this case user force API and not have to worry about these kernels of how to I'm so here's an example of how it's been consumed internally and this is on models model of 1 of our internal apps think in the project not a collection is a simply a model with the user will create an instance of and as such it will select a provider in this case like use your voice on the choices of populated from the registry there's a method on there that will group all the choice together on and the inputs phosphor user input that the plugin needs to execute whether it's all tokens or whatever and plugin developers responsible for telling it what it needs on this they will actually validate against the plug-ins inputs method to make sure that all the required input data and then on a color-coded here for brevity but in the process method recall and fetch the data and then create metrics internally and the beautiful thing about this is the point developed using the point in developer doesn't have to know how this is being consumed and KPI tree doesn't have to know what points talk about it's a very clean separation the the In earlier mentioned when about the metaclass how that works and i things get registered automatically when things are defined in important well 2 important so we have we use a start that the pine knowledge on all of our projects that quickly change now wishing to 1 7 but for the past 2 years we've wanted to organize all of our stop food in 1 place and not have to do things like import things into euros tie relying on the fact jingu order loads so and all of our projects we have at least this run method and the other word method to run discover for the and and to load all the receivers models where we store things like signal handlers on instead of putting signal handlers inside models we put in our receivers pikey that organized well so for the PPI tree project we this function Calypso modules and all its can induce a loop over this KPI tree integrations package can import all of its modules in our case they are points and that's what and when that happens again a rich so in order for this run method to execute we have to modify the 2 entry points are applications and that's the whiskey module you can see here with an import PPI tree start-up and cold start a prime to the same thing In many stuff I so as of Tuesday we've had over 5 thousand stargazers on crosses 60 of the next projects and for the ones are packaged and for example we have just start a project start a project templates on but the for the ones the package remotely close to many endowments I say this because you know with Cook sets class-based fusome plug ins With this helps make taps more extensible and in doing so we've seen greater re read reuse but as evidenced by these stars and downloads I like to think that were delighting our users at least some of them on and after 3 + years of working middle during I can honestly test that our media world standard both for us in our clients because I've seen that we're building more things and we're building and faster what's faster than where we were 3 years ago on both for ourselves and for our clients so I've covered a lot here really quick and this wasn't really designed the tutorial with this kind of get things get you thinking I'm around rest the afternoon if you want to talk anymore talking deeper about anything assignments scanner so that are there
questions you from student and this in turn