Record a design issue and design issue

Source: Internet
Author: User

Record a design issue and design issue

The requirements are as follows: there is A Class A and A subclass B, C, D

Abstract class A {abstract void fn ();} class B: A {override void fn () {}} class C: A {override void fn () {}} class D: A {override void fn (){}}


Obviously, B, C, and D must rewrite their respective fn () to complete their own functions. However, due to similar functions, the fn () Implementations of B, C, and D are almost the same. There are three ways to write this common function:

1. Add A protected member in A and then call it directly in B, C, and D.

2. Rewrite the abstract of A to virtual, and then call it through base. fn () in the subclass.

3. Create a new class and write it as a static function for calling B, C, and D.

Ask the next database design question. How can I set the information fields of the instructors in the school activity table to facilitate the export of activities of individual students?

This is obviously a multi-to-many relationship, so we use the third table to store this relationship.
Instructor information table (Instructor ID, name)
Activity record table (activity ID, name)
The fields of the participating table (Instructor ID and activity ID) are both foreign keys.
Teach a VF query designer

It should be clear that the question "male and female in English courses" means that it is definitely not only a class, so what is required here is not only grouping by class number, but also group by gender.
"LEFT (Xuesheng. Student ID, 8) AS class number" and "xuesheng. Gender" should be added after group

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.