Conversation started May 3, 2019 at 12:49.
May 3, 2019 12:49
Learning curve time: I've got a major addition to make to me main Access project. I want to do it "properly" (classes not procedural), but I don't even know how to start thinking about doing it that way.
time for a bit of TDD and Application design, huh?
I come up with the steps in the order they need to happen, but I'm not sure how to translate that into some classes and methods and...
yeah.
like, a full class on how to do that
One consideration, though. Bound forms makes it hard to do TDD the usual way.
Yes, you could use unbound forms, but if you're doing that... why use Access?
Might as well just program in C# + Visual Studio.
there will be very little form involved. Select an import profile, click "do it" and it takes off and does what it needs to do.
@this (even steeper learning curve)
That said, I do use classes in Access, mainly as "strategy" to extend and provide some functionalities. I've been also using interfaces over the forms for cross-referencing.
@FreeMan ah, yes. Background processing is much easier to "classify".
May 3, 2019 12:53
@Mug did a full-on OOP Battleship, so it's not impossible... I just don't know how to start thinking about doing it that way.
He did - but those are essentially unbound
I'm not really sure where to start thinking about what goes in which class and what it should do and what a different class should do and...
I would say before you write even a single line of code, write out a workflow that must happen.
and I don't mean generic like "if a, then do b"
you need to inventory all the data you will need to have in your "a" and what "b" must also have to do so.
more detailed than
3 mins ago, by FreeMan
there will be very little form involved. Select an import profile, click "do it" and it takes off and does what it needs to do.
:)
sketch that workflow out first, then you should be able to see a pattern and build classes around that.
Yeah
you must be able to answer questions like "what parameters must I have at that step? what data do I already have?" and more.
May 3, 2019 12:56
ok. Will start drawing/writing/doodling/drooling
don't worry about coding - just describe the process
it's a hard trap to avoid even for myself - i'm in middle of sketching and I start thinking about how I would structure class. Don't. Not yet, at least - until you've sketched the entire process, then you can start thinking about how your classes will be designed based on the workflow
write a very high-level-pseudocode-like God procedure that describes the process, then start to add detail then break it down?
see, you're thinking code.
we shouldn't even be talking about procedures at all!
boop! you are in a infinite, formless void! there is no code.
see, new concepts to wrap old brain around
describe what must happen at each step and is required to do this step
May 3, 2019 13:00
@FreeMan think at a higher abstraction level: what are the steps needed to make coffee do X?
click button (needs form)
Import data (needs location of source, location of destination)
Like that then start adding details?
@FreeMan , knowledge of how the data is structured
I've already more-or-less got that.
if your process requires a new calculation that is not in original data input, that's a step you must call out so you know how your data structure will change over the cycle of the workflow
May 3, 2019 13:07
Make coffee:
--Needs Coffee, Filter, Water
----Filter needs to be put in basket
----Water needs to be measured and put in water reservoir
------Mop up spills
----Coffee: is it ground or whole bean?
------Whole bean - needs to be ground
------Ground coffee needs to be measured and placed in filter
--Push "Start" button
kinda like that?
yes, you get the idea
okey doke.
off I go to make coffee import data
also, if you have to mop up spills... that's a lot of water.... maybe a tad too much, don't you think?
could just be shaking hands from not enough/too much coffee
poor aim
not having glasses on first thing in the morning
dog jumps on you
or, I suppose, too much water.
:)
oh... mop....
it's more common to wipe up the spills as opposed to mop. ;-)
May 3, 2019 13:10
generic term, fewer letters
lol
IDK about you guys but I've never mopped a counter before.
Wiped, yes. Mopped, never.
Clean = Iff(TooLarge(sizeOfSpill), Mop, Wipe)
You happy?
LOL
@this you obviously never lived in a fraternity house.
Do I look like a dude bro to you?
May 3, 2019 13:12
You look like an accusatory, pointing finger to me, so, sorta, yes.
nah. that's just what a prig would do.
(which I guess I am)
that's funny - a prig is a kind of brig; unlike a brig that keeps you in, a prig makes your life a hell
@FreeMan from here: Class: Filter, method: PutInBasket. Class: Water, methods: Measure, Pour, CleanUp. Class: Coffee, Property: beanState, methods: Grind, Measure, DumpInFilter. Class CoffeeMaker, Method: StartBrewing
^ sumpin' like that?
not related but I stumbled on the Filter being class. (normally, nouns => classes, and I was thinking the verb form). I would have called it FilterPaper to make it more obvious.
#NamingIsHard #PutItOffTillLater
You're on the track -- however, I would want to reorganize things because you can't "PutInBasket" to a filter paper. It has no basket.
I would expect it to be Coffeemaker.PutInBasket(filterPaper)
May 3, 2019 13:19
OK. makes sense
as it's the coffee maker that has a basket and thus can receive something in the basket.
But yes, you got the idea.
So far, this doesn't feel quite as foreign to designing a non-OOP process as I was thinking, but the end result is going to be different.
@MathieuGuindon He doesn't seem to know about the amend message command.
tries to remember the last time he designed and wrote down a process instead of just "air designing" and winging it...
Yes, the class design will be different if you do it OOP rather than procedural way, but the goal of that step is same -- getting as much of architecture as you can on the paper, so you can design ahead.
 
Conversation ended May 3, 2019 at 13:22.