Design Patterns, which one and how? (1 Viewer)

ADIGA88

Member
Local time
Today, 09:42
Joined
Apr 5, 2020
Messages
94
Hi to you all,

declaimer I am new to programming and measure my self as going from beginner trying to enter intermediate so bear with me.

in those days i working on an access application for my company for data entry, and i am in struggle to fine the right design pattern for OOP application (fancy words) that can tolerate change and development over time ( in near I am planning to use MS SQL as backend and separate the business logic from the frontend).

the problem is i am find it hard to do things in OOP, in comparison to procedure programming (ad hoc solution) for example when working the forms i found all the codes and modules coupled together, and required a recordset (DAO or ADO) to work so the dependency go all the way to the database, i start reading about (DI) Dependency Injection, IOC (inversion of control) and interfaces... etc to figure it out but with no luck.

so i need guidance or any ideas.
 

neuroman9999

Member
Local time
Today, 01:42
Joined
Aug 17, 2020
Messages
827
and i am in struggle to fine the right design pattern for OOP application (fancy words) that can tolerate change and development over time ( in near I am planning to use MS SQL as backend and separate the business logic from the frontend)
there is no magic way. and there never will be. the only thing you can be sure of is that the concept of OOP is nothing more than a hierarchial pattern of data and relationships between different types of data used for different purposes. just like almost anything really => the material world, the authoritative leveling of a government and its different departments, the cosmos, etc, etc....

so, what you are attempting to figure out is essentially what every professional developer in a large corporations is being asked to do now anyway. predictive analysis. literally everyone is delving into the game of guessing what consumers do before they do it. and it will work very well obviously, because there are billions of people in the world walking around all day clicking buttons second after second on their phones.

but, back to the point.....there is absolutely no way, in my opinion, to give guidance on a subject like this if you don't provide some other things that you are dealing with. such as, for example:
Code:
=> the industry your business is in
=> the type of data you are analyzing
=> the drivers of your data (e.g. - human behavior or business transactions)
=> the type of database you are working with
=> the uniqueness of the different types of data you are working with.  eg - is there data that is not often seen in business and/or analyzed?
=> etc, etc...
 

ADIGA88

Member
Local time
Today, 09:42
Joined
Apr 5, 2020
Messages
94
there is no magic way. and there never will be. the only thing you can be sure of is that the concept of OOP is nothing more than a hierarchial pattern of data and relationships between different types of data used for different purposes. just like almost anything really => the material world, the authoritative leveling of a government and its different departments, the cosmos, etc, etc....

so, what you are attempting to figure out is essentially what every professional developer in a large corporations is being asked to do now anyway. predictive analysis. literally everyone is delving into the game of guessing what consumers do before they do it. and it will work very well obviously, because there are billions of people in the world walking around all day clicking buttons second after second on their phones.

but, back to the point.....there is absolutely no way, in my opinion, to give guidance on a subject like this if you don't provide some other things that you are dealing with. such as, for example:
Code:
=> the industry your business is in
=> the type of data you are analyzing
=> the drivers of your data (e.g. - human behavior or business transactions)
=> the type of database you are working with
=> the uniqueness of the different types of data you are working with.  eg - is there data that is not often seen in business and/or analyzed?
=> etc, etc...


I have the feeling that there is no easy way, due to complexity and disburse of ideas. in some sense, it gives me relief that I am not doing it wrong.
The Thing is when I reading a book on OOP – or another subject. I been showered with concepts and words, that the writer expects me to know without a second thought. So, I tell myself there must be another book that explains those concepts (hierarchy in concepts I suppose) so I start looking for that book, and I only find books that teach you the baby steps of how assign variables and write function etc. And advance books that expect you to know everything about programming and tell you it’s time to learn OOP now.
I am looking for, if there a sequential list of book/blogs/articles that can build those concepts one at a time, and I guess there isn’t.
Regarding the goal of my efforts or what the desire outcome to it, its facts layout as follow:
• First it is a construction company
• The app intended to track if expenses for VAT and billing purposes
• There different types of expenses captured in vendor invoices and petty cash (invoices), working hour (timesheets).
• Tracking project progress for billing also
• I am using access 365
• The system will be distributed in LAN for time being
• The data come from two sources employee’s entry and imports from an ERP NAV 2018.
• The data types are defined and may add some attributes for advance tracking.
I think I can implement the app using procedure programming but I know there is will alot of change, request and oops I forgot to tell you we need this, so I can see the short coming of my approach so I am looking for another one.
 
Last edited:

ADIGA88

Member
Local time
Today, 09:42
Joined
Apr 5, 2020
Messages
94

neuroman9999

Member
Local time
Today, 01:42
Joined
Aug 17, 2020
Messages
827
ADIGA88,

I will respond to your follow up on my post, assuming you would like to read it. :) First, I didn't say anything about the 2 concepts you mentioned before, which were dependency injection and inversion of control. I don't use terms like this very often, but according to what I read here and here, both concepts are relevant to an access database, however the only reason is because they are both professional concept that are related to literally any software system.

First, regarding dependency injection, this is a universal concept in almost all large software system. Literally everything has a dependency. And, for people still learning what OOP is all about, you can really say in a generic sense that ""dependency"" is pretty much the same thing as ""inheritence"". Although, if you talked to a professional developer, they will swear that the two ideas are totally different. and yes, that is true, but in common sense terms and for the purpose of learning, relating the two is just fine to get a handle on the type of thinking that is needed here.

Secondly, regarding inversion of control.....according to what I read, it said this:
in traditional programming, the custom code that expresses the purpose of the program calls into reusable libraries to take care of generic tasks, but with inversion of control, it is the framework that calls into the custom, or task-specific, code.
now, that statement does mean something, however to some degree it is useless because all software programs use libraries to pull data resources and use them in a software program. the concept of a framework being used as the software executional driver is really no different than the use of libraries, other than the fact that a framework is a very well architected layout, written by professionals, strictly for the purpose (in my opinion) of making things easier for developers to pull resources and get what they need to produce the required products.

now, regarding what you have asked in your latest post....I will quote your words and comment on each quote from you:
Thing is when I reading a book on OOP I have been showerd with concepts and words, that the writer expect me to know. So I tell my self there must be another
The reason you are being showered with words, more than likely, is because whoever wrote that book is so smart, they're missing a critical piece of how to teach => relating to a human. professional words mean nothing to a beginner. all it does is bring a bunch of confusion.
And advance books that expect you to know everything about programming and tell you it’s time to learn OOP now.
well, this completely depends on what you will be doing. are you the programmer in this project? have you ever written code before? are you trained in it? If the answer to any of those questions is no, then you probably would do yourself a world of good by hiring a professional developer, simply because the advanced concepts of designing involve things like polymorph, abstraction, encapsulation, recursion, etc, etc.... And I can tell you that from a professional business person's mindset that is exactly like the way CEOs think, they have an obsession with patternizing everything for the purpose of making things run as smoothly as possible. The concepts of programming I've just referred to are heavily used in software design, however it does not mean that these are necessary in order to write even a semi-large scale application that runs just fine. The adoption of these is simply a matter of being ""professional"". There are other reasons too though, like the obsession of the world with efficiency, nonsensical worrying about energy usage, etc, etc...
I am looking for, if there a sequential list of book/blogs/articles that can build those concepts one at a time, and I guess there isn’t.
YES THERE IS. google can be used for this purpose, and the search is very easy. If you need to do it one a time, then runs those searches one at a time.
Regarding the goal of my efforts or what the desire outcome to it, its facts layout as follow:
• First it is a construction company
• The app intended to track if expenses for VAT and billing purposes
• There different types of expenses captured in vendor invoices and petty cash (invoices), working hour (timesheets).
• Tracking project progress for billing also
• I am using access 365
• The system will be distributed in LAN for time being
• The data come from two sources employee’s entry and imports from an ERP NAV 2018.
• The data types are defined and may add some attributes for advance tracking.
All of these points can be easily mapped to a table layout that is fairly easy to set up. As so many people around here say, reading about the concept of ""data normalization"" will help you out greatly. However, it doesn't mean that it solves all problems. Regarding the use of Access 365, that is irrelevant. However, I believe you can store Access files in the cloud when purchasing 365 subscriptions. The fact that you want the application to sit on a LAN doesn't mean much either, other than the fact that you would have to take into consideration any protocols associated with the LAN set up by your networking professionals. I can't really say much about that, but I would have doubt that if you're not careful, you can run into unexpected issues that you won't know about until you encounter them.

Regarding importing data from an ERP NAV 2018 system, the biggest issue with that more than likely will be how consistent the data is between that ERP and Access. In 20 years of doing this work, I can tell you that I've seen a countless number of times where someone complained about an import procedure because the source program treated data ""this way"" or it was in ""this format"", and when it came into access it was ""that way"" or the formatting is different. This is inevitable and there's no way around it. Strictly due to the nature of proprietary information and trade secrets related to how system are written, this frustration is something you will encounter almost daily regardless of what you're working with.
I think I can implement the app using procedure programming but I know there is will alot of change,
as I have said above, you can do almost anything with procedural processes, if you do not understand the concept of OOP. The only issue with it is that it will become extremely complex, hard to maintain/document, take a long long time to make updates and re-document, etc, etc.... One of the wonderful advantages of the OOP style of work is that it is very easy to document so the programmers who follow in the footsteps of the original writer can make it easy on themselves in terms of writing updates, changing things, etc.....

Does all of this help, at least a little bit? Hopefully you can make use of it. :)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:42
Joined
Feb 19, 2002
Messages
43,223
Since Access is a RAD (Rapid Application Development) tool rather than a pure programming environment, you are best advised to do things the "Access" way. Attempting to impose some other methodology on top of Access will simply not make your job easier. You would be better off to study thought processes that are more in sync with Access objects and VBA. Understanding coupling and cohesion will go a long way toward making your applications agile and modifiable.

Coupling refers to the connections between objects and Cohesion refers to the connections within an object. Your objective will be to minimize coupling (the fewer connections between objects, the better) and maximize cohesion (don't combine procedures that are not actually related). Both of these go a long way toward preventing the ripple effect caused by changing a when c and d depend on a and don't like the change. Make small procedures that do specific things. Call them from larger procedures that provide sequencing if things need to be don in a particular order.

Making bad Class modules will NOT help you. The idea is to reduce the scope of a procedure to something that is useful and has potential to be reused. But, more importantly, is having the experience to recognize what procedures/objects have the potential to be reused. Not all procedures/objects will ever be shared, nor should they be. If you find that your procedures have only one or two statements, you are going about this at too low a level. I once acquired an app that required a change. It was built by someone who clearly hated Access and felt it was beneath him. As I started following code to find out where the change needed to be made (it wasn't obvious from the top level organization), I kept finding myself drilling down 5, 7, 10 levels with each procedure I opened having only one or two lines of code. The app was impossible to comprehend. I kept copying the code and building procedures that actually did something in order to get my head around the objective of any given procedure. To this day, I curse the offspring of this idiot. Please don't become him.
 
Last edited:

ADIGA88

Member
Local time
Today, 09:42
Joined
Apr 5, 2020
Messages
94
Pat Hartman

I looked up RAD on Wikipedia and one of the process is Construction phase suggest Unite Testing for example
Construction phase – focuses on program and application development task similar to the SDLC. In RAD, however, users continue to participate and can still suggest changes or improvements as actual screens or reports are developed. Its tasks are programming and application development, coding, unit-integration and system testing.
and access doesn't support that - there is add-in called rubberduck can give such feature to VBE - and one of the condition of unite testing is to decouple the dependencies of classes and modules and to do the decoupling we need IoC (inversion of control), DI (Dependency Inversion) and so on, so we come back to square zero, my point is every programming feature (not business) required additional tools or technique and it's may or may not be available in access, and what i am looking for the references/resources that can explain their concepts.
 

Users who are viewing this thread

Top Bottom