Re: [python-uk] hexagonal Django
Thanks Peter! I was speaking to Brandon at Pycon this year and he was telling me this was going to be his next talk to take on the road, and I was definitely looking forward to seeing it. Matt O'Donnell was also there, and he's done a talk on this sort of thing recently too ( https://www.youtube.com/watch?v=NGhL7IA6Dik). It's definitely in the air. My own modest attempts to approach the subject are in my book -- in chapter 19, where I show how striving for test isolation can (theoretically) push you towards something like a lean architecture ( http://chimera.labs.oreilly.com/books/123400754/ch19.html) and in chapter 21, the wrap-up, where I waffle on about all these things ( http://chimera.labs.oreilly.com/books/123400754/ch22.html) I don't think I managed to broach the subject nearly as cleanly as Brandon did. I really admire his talks. His data structures talk was one of the top 3 I saw at Pycon this year ( http://pyvideo.org/video/2571/all-your-ducks-in-a-row-data-structures-in-the-s). Perfect pace, slides that complement rather than repeat the talk, fascinating and useful content... Anyways, back to our onions - I guess the thing that's always bothered me a bit about the "clean architecture" is that my main project (pythonanywhere) is "all boundaries", to use Gary Bernhardt's terminology. Or, to put it differently, I don't think we really have much in the way of "business logic". We just turn Http requests into commands that go to processes. There's really not much in the way of "logic" in the way. No calculations or business rules to speak of. So it's never seemed worth it, to us. And sometimes I think -- aren't many web projects just thin CRUD wrappers around a database? Is going to all the trouble of isolating your business logic from, eg, django, really worth it in most cases? On 13 August 2014 13:09, Daniel Pope wrote: > Coincidentally, I blogged on the topic of Django project organisation at > the weekend. > > http://mauveweb.co.uk/posts/2014/08/organising-django-projects.html > > May be of interest? > > ___ > python-uk mailing list > python-uk@python.org > https://mail.python.org/mailman/listinfo/python-uk > > -- -- Harry J.W. Percival -- Twitter: @hjwp Mobile: +44 (0) 78877 02511 Skype: harry.percival ___ python-uk mailing list python-uk@python.org https://mail.python.org/mailman/listinfo/python-uk
Re: [python-uk] hexagonal Django
You know, if you started writing a stand alone module called pythonanywhere that has no dependencies and was imported and used by Django, Tornado, and any of the other bits and pieces I think you might find a *few *things to put in there... Not that I have any knowledge of that code base, of course ;-) On Fri, Aug 15, 2014 at 11:22 AM, Harry Percival wrote: > Thanks Peter! I was speaking to Brandon at Pycon this year and he was > telling me this was going to be his next talk to take on the road, and I > was definitely looking forward to seeing it. Matt O'Donnell was also > there, and he's done a talk on this sort of thing recently too ( > https://www.youtube.com/watch?v=NGhL7IA6Dik). It's definitely in the air. > > My own modest attempts to approach the subject are in my book -- in > chapter 19, where I show how striving for test isolation can > (theoretically) push you towards something like a lean architecture ( > http://chimera.labs.oreilly.com/books/123400754/ch19.html) and in > chapter 21, the wrap-up, where I waffle on about all these things ( > http://chimera.labs.oreilly.com/books/123400754/ch22.html) > > I don't think I managed to broach the subject nearly as cleanly as Brandon > did. I really admire his talks. His data structures talk was one of the > top 3 I saw at Pycon this year ( > http://pyvideo.org/video/2571/all-your-ducks-in-a-row-data-structures-in-the-s). > Perfect pace, slides that complement rather than repeat the talk, > fascinating and useful content... > > Anyways, back to our onions - I guess the thing that's always bothered me > a bit about the "clean architecture" is that my main project > (pythonanywhere) is "all boundaries", to use Gary Bernhardt's terminology. > Or, to put it differently, I don't think we really have much in the way of > "business logic". We just turn Http requests into commands that go to > processes. There's really not much in the way of "logic" in the way. No > calculations or business rules to speak of. So it's never seemed worth it, > to us. > > And sometimes I think -- aren't many web projects just thin CRUD wrappers > around a database? Is going to all the trouble of isolating your business > logic from, eg, django, really worth it in most cases? > > > > > On 13 August 2014 13:09, Daniel Pope wrote: > >> Coincidentally, I blogged on the topic of Django project organisation at >> the weekend. >> >> http://mauveweb.co.uk/posts/2014/08/organising-django-projects.html >> >> May be of interest? >> >> ___ >> python-uk mailing list >> python-uk@python.org >> https://mail.python.org/mailman/listinfo/python-uk >> >> > > > -- > -- > Harry J.W. Percival > -- > Twitter: @hjwp > Mobile: +44 (0) 78877 02511 > Skype: harry.percival > > ___ > python-uk mailing list > python-uk@python.org > https://mail.python.org/mailman/listinfo/python-uk > > -- Hansel ___ python-uk mailing list python-uk@python.org https://mail.python.org/mailman/listinfo/python-uk
Re: [python-uk] hexagonal Django
I think what you describe is a common situation. When I reorganised that application in a Django project, that was one aspect that bugged some of my coworkers. But I think there is potentially still some value there. The resulting one line business functions create a well-defined seam between your app's (slender) business logic and each of your interfaces to external systems. That way, you make it easy for developers to avoid accidentally mixing 'django' code into the same module as code which talks to ElasticSearch. If you already have the discipline to maintain great separation of concerns (along these or other lines), which I'm guessing PythonAnywhere still does, then perhaps you don't need this particular constraint to help you maintain it. Is there also value in helping you plug in fake external services for testing purposes? I believe there is, but again, I'm not sure this value is greater than zero if you *already* have well thought-out mechanisms for plugging in fake external systems. Jonathan On 15/08/14 11:22, Harry Percival wrote: Thanks Peter! I was speaking to Brandon at Pycon this year and he was telling me this was going to be his next talk to take on the road, and I was definitely looking forward to seeing it. Matt O'Donnell was also there, and he's done a talk on this sort of thing recently too ( https://www.youtube.com/watch?v=NGhL7IA6Dik). It's definitely in the air. My own modest attempts to approach the subject are in my book -- in chapter 19, where I show how striving for test isolation can (theoretically) push you towards something like a lean architecture ( http://chimera.labs.oreilly.com/books/123400754/ch19.html) and in chapter 21, the wrap-up, where I waffle on about all these things ( http://chimera.labs.oreilly.com/books/123400754/ch22.html) I don't think I managed to broach the subject nearly as cleanly as Brandon did. I really admire his talks. His data structures talk was one of the top 3 I saw at Pycon this year ( http://pyvideo.org/video/2571/all-your-ducks-in-a-row-data-structures-in-the-s). Perfect pace, slides that complement rather than repeat the talk, fascinating and useful content... Anyways, back to our onions - I guess the thing that's always bothered me a bit about the "clean architecture" is that my main project (pythonanywhere) is "all boundaries", to use Gary Bernhardt's terminology. Or, to put it differently, I don't think we really have much in the way of "business logic". We just turn Http requests into commands that go to processes. There's really not much in the way of "logic" in the way. No calculations or business rules to speak of. So it's never seemed worth it, to us. And sometimes I think -- aren't many web projects just thin CRUD wrappers around a database? Is going to all the trouble of isolating your business logic from, eg, django, really worth it in most cases? On 13 August 2014 13:09, Daniel Pope wrote: Coincidentally, I blogged on the topic of Django project organisation at the weekend. http://mauveweb.co.uk/posts/2014/08/organising-django-projects.html May be of interest? ___ python-uk mailing list python-uk@python.org https://mail.python.org/mailman/listinfo/python-uk ___ python-uk mailing list python-uk@python.org https://mail.python.org/mailman/listinfo/python-uk -- Jonathan Hartleytart...@tartley.comhttp://tartley.com Made of meat. +44 7737 062 225 twitter/skype: tartley ___ python-uk mailing list python-uk@python.org https://mail.python.org/mailman/listinfo/python-uk