Need help creating an object model

62 views
Skip to first unread message

Jason Turner

unread,
Oct 16, 2013, 9:12:24 AM10/16/13
to excel-r...@googlegroups.com


Hello Everyone,

This website is mind blowing for a simple Mechanical Engineer like myself.  Thank you Bruce for creating this. Even though I am not very good at it (yet), I enjoy programming. I thought a good project to learn on would be to create a resource planning application. Attached is an outline of the proposed object model as well as a stripped down version of the workbook which includes 4 sheets: Assemblies, purchased parts, internal operations, and external operations; each having properties defined in the VBE. The complexity of cDataSets and the classes associated with it make it difficult for my untrained eye to follow and for starters all I want to do is create the object model with the defined parent child relationships. I was trying to pick apart the roadmapper example to figure out how to do this but it is WAY over my head at this point.

This is merely a request for advice, resources, starting points, etc. to get me (re)started in the right direction.

Much thanks in advance to anyone with any input

Jason
RubyOM.xlsm
Ruby2000 Object Model.docx

Bruce Mcpherson

unread,
Oct 16, 2013, 10:02:29 AM10/16/13
to excel-r...@googlegroups.com

I think you are building a lot of specificity into your classes that probably should be parameterized or data driven

What are you planning to do with this object model ..

unless this is purely a learning exercise, I would first of all draw out the process model, how it would be used, who would use it, what functions what it would perform, how and where the data would be stored etc.. 

bruce


--
You received this message because you are subscribed to the Google Groups "Excel Liberation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excel-ramblin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jason Turner

unread,
Oct 16, 2013, 10:57:53 AM10/16/13
to excel-r...@googlegroups.com

Thanks for the speedy reply Bruce, let me start by saying that I am not sure what you mean by "parameterized  or data driven". This application is not purely educational, eventually it will be used to predict lead times, track inventory and roll up costs. I have spent the last month or two defining my process, it's users, and functionality. I had a lot of code written and then I realized what I was trying to create was an object hierarchy and it might be easier to create the object model and navigate recursively through it to find the lead time and what purchased parts would be needed for any given assembly. I realize how in over my head I am, but I'm also fairly stubborn and not prone to giving up very easily.

Thanks again


Jason

Bruce Mcpherson

unread,
Oct 16, 2013, 11:41:27 AM10/16/13
to excel-r...@googlegroups.com
Hi Jason, 

what i meant by data driven or parameter is that your classes would need to be changed if there were new attribute fields needed for some items, since you've made an attribute a property. (for example if you wanted to add, say, color as an attribute for some part). If these are all fixed then that's fine. 

what i understand from brief look is that you are looking to make this model recursive, with an indeterminate depth of assemblies/subassembly/part relationships.. 

could the the same part apply to multiple assemblies - because since the target attribute (which i take to mean parent) is associated with the child, and there might be multple targets? 

Rather than cDataSet, you may want to take a look at the cJobject class which is a data driven recursive class - allowing creation and manipulations of object models on the fly


I use it for this kind of thing all the time to avoid creating specific classes and where i need recursion and hierarchies of unknown depth - a couple of examples are as follows 



It also knows about JSON for integration with other systems. 

The whole recursion thing can be tricky

bruce

Jason Turner

unread,
Jan 6, 2014, 3:39:40 PM1/6/14
to excel-r...@googlegroups.com
Hello again Bruce,

I got busy with other projects and have since got back to work on this project, so I haven't given up, but I have more ?'s. I have created the object model using cjObject.  I am now at a point where I need to be able to manipulate (read/write) certain values (i.e. quantity in stock) in the object model. Or would it be best to create a worksheet from the object model and add "quantity in stock" in the worksheet?  Just wondering the best way to proceed. 

Thanks,

Jason

Bruce McPherson

unread,
Jan 6, 2014, 5:22:05 PM1/6/14
to excel-r...@googlegroups.com
Once data is in cjobject, it can be manipulated anyway you want. There's no need to go to the worksheet format, except for reporting. You can even store or read the entire thing to or from json text in a worksheet cell for data persistence.

Sent from my iPad
--

Jason Turner

unread,
Feb 21, 2014, 4:34:17 PM2/21/14
to excel-r...@googlegroups.com
Hello again Bruce,

On Jan 6, you said,

"Once data is in cjobject, it can be manipulated anyway you want. There's no need to go to the worksheet format, except for reporting. You can even store or read the entire thing to or from json text in a worksheet cell for data persistence."

So I have my ADD_STOCK() sub working. It changes the values of properties within my cJobject, but as expected as soon as I close the userform and the cJobject goes out of scope the updated values go out of scope as well. Now I very kindly ask you how to "store and read the entire thing to or from json text in a worksheet cell for data persistence", and how to report this in a worksheet format.

Thanks

On Wednesday, October 16, 2013 7:12:24 AM UTC-6, Jason Turner wrote:

Bruce McPherson

unread,
Feb 21, 2014, 6:44:05 PM2/21/14
to excel-r...@googlegroups.com
Here's how you can hide persistent data somewhere In a spreadsheet. 
http://ramblings.mcpher.com/Home/excelquirks/recursionlink/hiding-data-in-excel-objects/persistence

However you may want to consider a cloud based nosql database .. For example parse.com...


Bruce





Sent from my iPad
--
Reply all
Reply to author
Forward
0 new messages