Re: [Tutor] "Object designer" applications - are there any?
Yup - sounds more like what the final version of my little project will do. At the moment, I'm more interested in taking each specific database's version of it's DDL and converting it to an Oracle version of that DDL, so initially it's not much more than a text converter which reads in text describing Sybase tables and spits out DDL describing Oracle tables. I'll spend a day working out my objects, their methods and properties, get that all nailed and begin the fun and games in translating my headspace into Python. I'll inevitably hassling you people as and when I get stuck or want some advice on the best way to proceed, so I guess by the end of it, you'll all be as sick of this as I will be. Share the misery... S From: ALAN GAULD [mailto:alan.ga...@btinternet.com] Sent: Friday, August 05, 2011 4:34 PM To: Flynn, Stephen (L & P - IT); tutor@python.org Subject: Re: [Tutor] "Object designer" applications - are there any? > > I'm not sure you need OOP for this. > I suspect you're correct Alan, but as I'm using this an a learning > exercise for the language it seemed too good an opportunity to miss That's fine so long as we understand why you are going down the OOP route. > can relate a table to an "object" in my head quite easily - just need to > know how to do it in Python... OK, So if you can conceptualise a table what are the operations you would perform on it? It sounds like you want to - add columns - from a definition file/document? - generate DDL based on current structure? - export a definition document? - Maybe autopopulate the definition from a given database connection? So the use case nmay be something like: Create a table connected to the old database. The table sucks up the metadata from the database and auto-populates itself with columns(which might be another class with name, type,size type details) Create a new Table object targeted at the new database (which might not exist yet?) If the table can't auto-populate then feed it the oold table object which it queries for a description. The new table then populates its own definition. Finally get the new table to generate the DDL and populate the new database. You might want different table classes each based on different databases, so they populate themselves based on the specific meta language and spit out a common description format. They cn then generate their own dialect of DDL too... Does that seem like a starter? But really, when working with objects it helps to sit back and think through how you want to use them from the outside rather than thinking about what they look like inside. That way the internals will reflect what's actually needed for the usage rather than some random model of what might be needed. HTH, Alan G. Click here <https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== 1AVZPhIxlsZ4UqhB+qagH4nqPtDbwPBBNdVeTFI5G433hQ==> to report this email as spam. This email and any attachment to it are confidential. Unless you are the intended recipient, you may not use, copy or disclose either the message or any information contained in the message. If you are not the intended recipient, you should delete this email and notify the sender immediately. Any views or opinions expressed in this email are those of the sender only, unless otherwise stated. All copyright in any Capita material in this email is reserved. All emails, incoming and outgoing, may be recorded by Capita and monitored for legitimate business purposes. Capita exclude all liability for any loss or damage arising or resulting from the receipt, use or transmission of this email to the fullest extent permitted by law. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] "Object designer" applications - are there any?
> > I'm not sure you need OOP for this. > I suspect you're correct Alan, but as I'm using this an a learning > exercise for the language it seemed too good an opportunity to miss That's fine so long as we understand why you are going down the OOP route. > can relate a table to an "object" in my head quite easily - just need to > know how to do it in Python... OK, So if you can conceptualise a table what are the operations you would perform on it? It sounds like you want to - add columns - from a definition file/document? - generate DDL based on current structure? - export a definition document? - Maybe autopopulate the definition from a given database connection? So the use case nmay be something like: Create a table connected to the old database. The table sucks up the metadata from the database and auto-populates itself with columns(which might be another class with name, type,size type details) Create a new Table object targeted at the new database (which might not exist yet?) If the table can't auto-populate then feed it the oold table object which it queries for a description. The new table then populates its own definition. Finally get the new table to generate the DDL and populate the new database. You might want different table classes each based on different databases, so they populate themselves based on the specific meta language and spit out a common description format. They cn then generate their own dialect of DDL too... Does that seem like a starter? But really, when working with objects it helps to sit back and think through how you want to use them from the outside rather than thinking about what they look like inside. That way the internals will reflect what's actually needed for the usage rather than some random model of what might be needed. HTH, Alan G.___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] "Object designer" applications - are there any?
> It struck me that if I write a "read in Sybase DDL and spit out Oracle DDL" > routine and so forth, I'd get a lot of reuse out of it. However, I've not > done much OOP at all and consequently, my object design skills are somewhat > non-existent. Whilst I have a rough idea of what my properties my "table" > object will have I was looking for something to help me design it - something > which I can say "this is a table object, it has a name and multiple columns. > Columns have a type, a width (which may be further comprised of scale and > precision or just an integer depending on the column type) and a "nullable" > flag.). Oh, and there may be multiple columns... so maybe a column should be > an object too... etc. > > Anyone know if there are any such kinds of programs out there already > (freeware please - I'll be doing this off my own back so funds are tight for > commercial software). Failing that, does anyone use something for this kind > of thing already, Visio maybe or a spreadsheet. Maybe just notepad or a > post-it? > > Perhaps most people just design their objects on paper and let the code do > the documentation for them... I don't know as I've never done this before. > > It doesn't strike me as being a complicated project at first glance - all > it's doing is translating structured DDL into structured Oracle DDL, but I'd > like to get my first principles correct so that I don't end up 3 weeks in and > realise I've made a fundament design flaw ("Crap - I didn't think of anything > to describe table indexes" or "Hmm - views is a "view" just another > "table" or should I describe a view in the SQL it'll actually use, so it's > just a piece of text and how does that translate to a materialized view" > and so forth...) and have to re-do chunks... or maybe I do want to do that, > to make sure I get my design nailed before a line of code is ground out. > > > I'm open to suggestions on what useful tools are out there to make my > learning experience easier, more pleasant and satisfying - if that involves > the back of fag packets, so be it. :) I'm typing this on a phone, so I'll keep it short. There are two great books that could be useful: "Head First Object-Oriented Analysis & Design" and "Python 3 Object Oriented Programming". Head First assumes knowledge of java but is useful for learning OO (though some keywords are different, most code is understandable if you know python), wjile Python 3 is very dry and technical, but really goes in-depth with OO programming and the philosophies behind it (the first chapter really helped me wrap my head around OO and inheritance and encapsulation and what have you). As for diagrams I believe UML is sufficient and there are resources abound online for that, and Visio can easily handle UML standards. best regards, Robert S. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] "Object designer" applications - are there any?
> > However, I've not done much OOP at all > > I'm not sure you need OOP for this. As you say a "routine" ie a function > might be all you need along with some data structures - probably > dictionaries to define the translations needed. I suspect you're correct Alan, but as I'm using this an a learning exercise for the language it seemed too good an opportunity to miss - I can relate a table to an "object" in my head quite easily - just need to know how to do it in Python... S. This email and any attachment to it are confidential. Unless you are the intended recipient, you may not use, copy or disclose either the message or any information contained in the message. If you are not the intended recipient, you should delete this email and notify the sender immediately. Any views or opinions expressed in this email are those of the sender only, unless otherwise stated. All copyright in any Capita material in this email is reserved. All emails, incoming and outgoing, may be recorded by Capita and monitored for legitimate business purposes. Capita exclude all liability for any loss or damage arising or resulting from the receipt, use or transmission of this email to the fullest extent permitted by law. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] "Object designer" applications - are there any?
Stephen, You might check out the SQL management tools from Embarcadero. They may provide some of the conversion capabilities you are looking for. And they generate beautiful documentation. Perhaps you could wrap the features of this product with Python scripts to acheive your goals? Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] "Object designer" applications - are there any?
On 05/08/11 12:01, Flynn, Stephen (L & P - IT) wrote: Anyway, nearly all of this work, at some point, involves me reading a Data Dictionary > for the source system and converting it to an Oracle table definition. More often than not this DDL is in text form and I convert it to Oracle DDL such as Create Table wibble ( clientrefNUMBER(10) not null, bthdteNUMBER(5) not null, natinr_no VARCHAR2(16) not null, etc ) It struck me that if I write a "read in Sybase DDL and spit out Oracle DDL" routine > and so forth, I'd get a lot of reuse out of it. However, I've not done much OOP at all I'm not sure you need OOP for this. As you say a "routine" ie a function might be all you need along with some data structures - probably dictionaries to define the translations needed. Perhaps most people just design their objects on paper and let > the code do the documentation for them... It depends on the complexity. For a big project (say >25 classes) I'd use a UML design tool like IBM RSA (Rational Rose as was) or Borland Together. But for small projects Visio/Power[point and some documentation in the code would suffice. And for very small designs (2 or 3 classes) it would just be the code! Biut for this it seems that a simple function to generte the DDL based on an input translation table should be feasible, with no objects required. (You could use objects of course if you really want but I don't think they're necessary, or even particularly helpful, in this case. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] "Object designer" applications - are there any?
I'll certainly give it a look-see - thanks Christian I'm going to end up writing converters anyway, as at some point I'm going to be given (for example) a COBOL copybook for a file and have to translate that into an Oracle table version (actually I already have tools to do this, but if I'm going to be learning python via a project, I might as well do it properly). S. From: Christian Witts [mailto:cwi...@compuscan.co.za] Sent: Friday, August 05, 2011 1:10 PM To: Flynn, Stephen (L & P - IT) Cc: Tutor List Subject: Re: [Tutor] "Object designer" applications - are there any? On 2011/08/05 01:01 PM, Flynn, Stephen (L & P - IT) wrote: It struck me that if I write a "read in Sybase DDL and spit out Oracle DDL" routine and so forth, I'd get a lot of reuse out of it. However, I've not done much OOP at all and consequently, my object design skills are somewhat non-existent. Whilst I have a rough idea of what my properties my "table" object will have I was looking for something to help me design it - something which I can say "this is a table object, it has a name and multiple columns. Columns have a type, a width (which may be further comprised of scale and precision or just an integer depending on the column type) and a "nullable" flag.). Oh, and there may be multiple columns... so maybe a column should be an object too... etc. Anyone know if there are any such kinds of programs out there already (freeware please - I'll be doing this off my own back so funds are tight for commercial software). Failing that, does anyone use something for this kind of thing already, Visio maybe or a spreadsheet. Maybe just notepad or a post-it? You could take a look at SQLAlchemy [1] and possibly the migrate [2] portion of it for schema management. It supports connectivity for both Sybase and Oracle as well as being able to generate the DDL [3] [1] http://www.sqlalchemy.org/docs/ [2] http://packages.python.org/sqlalchemy-migrate/versioning.html#experiment al-commands [3] http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABL Eoutputasastring -- Christian Witts Python Developer Click here <https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== HJ1tjFMsX3ETe+EpcmOPU7kNPtDbwPBBNdXC8dmstCo9uQ==> to report this email as spam. This email and any attachment to it are confidential. Unless you are the intended recipient, you may not use, copy or disclose either the message or any information contained in the message. If you are not the intended recipient, you should delete this email and notify the sender immediately. Any views or opinions expressed in this email are those of the sender only, unless otherwise stated. All copyright in any Capita material in this email is reserved. All emails, incoming and outgoing, may be recorded by Capita and monitored for legitimate business purposes. Capita exclude all liability for any loss or damage arising or resulting from the receipt, use or transmission of this email to the fullest extent permitted by law. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] "Object designer" applications - are there any?
On 2011/08/05 01:01 PM, Flynn, Stephen (L & P - IT) wrote: It struck me that if I write a "read in Sybase DDL and spit out Oracle DDL" routine and so forth, I'd get a lot of reuse out of it. However, I've not done much OOP at all and consequently, my object design skills are somewhat non-existent. Whilst I have a rough idea of what my properties my "table" object will have I was looking for something to help me design it - something which I can say "this is a table object, it has a name and multiple columns. Columns have a type, a width (which may be further comprised of scale and precision or just an integer depending on the column type) and a "nullable" flag.). Oh, and there may be multiple columns... so maybe a column should be an object too... etc. Anyone know if there are any such kinds of programs out there already (freeware please - I'll be doing this off my own back so funds are tight for commercial software). Failing that, does anyone use something for this kind of thing already, Visio maybe or a spreadsheet. Maybe just notepad or a post-it? You could take a look at SQLAlchemy [1] and possibly the migrate [2] portion of it for schema management. It supports connectivity for both Sybase and Oracle as well as being able to generate the DDL [3] [1] http://www.sqlalchemy.org/docs/ [2] http://packages.python.org/sqlalchemy-migrate/versioning.html#experimental-commands [3] http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring -- Christian Witts Python Developer // ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] "Object designer" applications - are there any?
I'm about to embark on a project in Python (primarily in order to learn the language and equally importantly, to make my life easier at work). I'm an IBM MVS Operations Analyst by trade by recently I've been spending more and more time working on Data Migrations; legacy systems in VSAM files, ADABAS, DB2, Oracle, SQL Server, Sybase and most recently we're about to start off on Tandem, which should be interesting! Anyway, nearly all of this work, at some point, involves me reading a Data Dictionary for the source system and converting it to an Oracle table definition. More often than not this DDL is in text form and I convert it to Oracle DDL such as Create Table wibble ( clientrefNUMBER(10) not null, bthdteNUMBER(5) not null, natinr_no VARCHAR2(16) not null, etc ) It struck me that if I write a "read in Sybase DDL and spit out Oracle DDL" routine and so forth, I'd get a lot of reuse out of it. However, I've not done much OOP at all and consequently, my object design skills are somewhat non-existent. Whilst I have a rough idea of what my properties my "table" object will have I was looking for something to help me design it - something which I can say "this is a table object, it has a name and multiple columns. Columns have a type, a width (which may be further comprised of scale and precision or just an integer depending on the column type) and a "nullable" flag.). Oh, and there may be multiple columns... so maybe a column should be an object too... etc. Anyone know if there are any such kinds of programs out there already (freeware please - I'll be doing this off my own back so funds are tight for commercial software). Failing that, does anyone use something for this kind of thing already, Visio maybe or a spreadsheet. Maybe just notepad or a post-it? Perhaps most people just design their objects on paper and let the code do the documentation for them... I don't know as I've never done this before. It doesn't strike me as being a complicated project at first glance - all it's doing is translating structured DDL into structured Oracle DDL, but I'd like to get my first principles correct so that I don't end up 3 weeks in and realise I've made a fundament design flaw ("Crap - I didn't think of anything to describe table indexes" or "Hmm - views is a "view" just another "table" or should I describe a view in the SQL it'll actually use, so it's just a piece of text and how does that translate to a materialized view" and so forth...) and have to re-do chunks... or maybe I do want to do that, to make sure I get my design nailed before a line of code is ground out. I'm open to suggestions on what useful tools are out there to make my learning experience easier, more pleasant and satisfying - if that involves the back of fag packets, so be it. :) -- Steve Flynn Technical Architect Tel 01242 670864 CLPS Elixir Project Office Capita Life & Pensions Services S4, The Grange Bishops Cleeve GL52 8XX www.capita-lps.co.uk Part of the Capita Group plc - www.capita.co.uk Capita Life & Pensions Services Limited is registered in England No 4359665 Capita Life & Pensions Regulated Services Limited is registered in England No 2424853 Registered Office: 71 Victoria Street, Westminster, London, SW1H 0XA This email and any attachment to it are confidential. Unless you are the intended recipient, you may not use, copy or disclose either the message or any information contained in the message. If you are not the intended recipient, you should delete this email and notify the sender immediately. Any views or opinions expressed in this email are those of the sender only, unless otherwise stated. All copyright in any Capita material in this email is reserved. All emails, incoming and outgoing, may be recorded by Capita and monitored for legitimate business purposes. Capita exclude all liability for any loss or damage arising or resulting from the receipt, use or transmission of this email to the fullest extent permitted by law. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor